Skip to content
Closed

Perso #1767

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
vim.o.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.o.relativenumber = true
vim.opt.relativenumber = true

-- Enable mouse mode, can be useful for resizing splits for example!
vim.o.mouse = 'a'
Expand All @@ -121,6 +121,11 @@ end)
-- Enable break indent
vim.o.breakindent = true

-- Tab behaviour
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true

-- Save undo history
vim.o.undofile = true

Expand Down Expand Up @@ -173,6 +178,33 @@ vim.o.confirm = true
-- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')

-- [[custom keymap]]
-- select move
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")

-- select indent
vim.keymap.set('v', '<', '<gv')
vim.keymap.set('v', '>', '>gv')

-- Explorer
vim.keymap.set('n', '<leader>x', vim.cmd.Ex)

-- Center page scroll
vim.keymap.set('n', '<C-d>', '<C-d>zz')
vim.keymap.set('n', '<C-u>', '<C-u>zz')

-- Yank/Past
-- p without overriding default register
vim.keymap.set("x", "<leader>p", [["_dP]])
-- yank to os clipboard
vim.keymap.set({"n", "v"}, "<leader>y", [["+y]])
-- yank line to os clipboard
vim.keymap.set("n", "<leader>Y", [["+Y]])
-- delete to void register
vim.keymap.set({"n", "v"}, "<leader>d", "\"_d")


-- Diagnostic keymaps
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })

Expand Down
2 changes: 1 addition & 1 deletion lua/custom/plugins/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- You can add your own plugins here or in other files in this directory!
-- ou can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
Expand Down
Loading