Add extra plugins
This commit is contained in:
parent
ca75729c7a
commit
2d4fe69a06
10 changed files with 201 additions and 0 deletions
51
lua/custom/configs/maps.lua
Normal file
51
lua/custom/configs/maps.lua
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
local function map(mode, lhs, rhs)
|
||||
vim.keymap.set(mode, lhs, rhs, { silent = true })
|
||||
end
|
||||
|
||||
-- Save
|
||||
map("n", "<leader>w", "<CMD>update<CR>")
|
||||
|
||||
-- Quit
|
||||
map("n", "<leader>q", "<CMD>q<CR>")
|
||||
|
||||
-- Exit insert mode
|
||||
map("i", "jj", "<ESC>")
|
||||
|
||||
-- Window split
|
||||
map("n", "<leader>sv", "<CMD>vsplit<CR>")
|
||||
map("n", "<leader>sh", "<CMD>split<CR>")
|
||||
|
||||
-- Window resize
|
||||
map("n", "<c-Left>", "<c-w><")
|
||||
map("n", "<c-Right>", "<c-w>>")
|
||||
map("n", "<c-Up>", "<c-w>+")
|
||||
map("n", "<c-Down>", "<c-w>-")
|
||||
|
||||
-- Move selected line / block of text in visual mode
|
||||
map("v", "J", ":m '>+1<CR>gv=gv")
|
||||
map("v", "K", ":m '<-2<CR>gv-gv")
|
||||
|
||||
map("n", "J", "mzJ`z")
|
||||
map("n", "<C-d>", "<C-d>zz")
|
||||
map("n", "<C-u>", "<C-u>zz")
|
||||
map("n", "n", "nzzzv")
|
||||
map("n", "N", "Nzzzv")
|
||||
|
||||
-- Buffer
|
||||
map("n", "<TAB>", "<CMD>bnext<CR>")
|
||||
map("n", "<s-TAB>", "<CMD>bprevious<CR>")
|
||||
|
||||
map("n", "Q", "<Nop>")
|
||||
map("n", "<c-f>", "<CMD>silent !tmux new tmux-sessionizer<CR>")
|
||||
|
||||
-- LSP format
|
||||
map("n", "<leader>f", function()
|
||||
vim.lsp.buf.format()
|
||||
end)
|
||||
|
||||
-- Search and replace
|
||||
map("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
|
||||
-- Reset highlight
|
||||
map("n", "<CR>", "<CMD>noh<CR><CR>")
|
||||
40
lua/custom/configs/settings.lua
Normal file
40
lua/custom/configs/settings.lua
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
local global = vim.g
|
||||
local o = vim.o
|
||||
|
||||
-- Copilot
|
||||
global.copilot_assume_mapped = true
|
||||
|
||||
-- Editor options
|
||||
o.relativenumber = true
|
||||
o.syntax = 'on'
|
||||
o.autoindent = true
|
||||
o.cursorline = true
|
||||
o.expandtab = true
|
||||
o.shiftwidth = 2
|
||||
o.tabstop = 2
|
||||
o.encoding = 'utf-8'
|
||||
o.ruler = true
|
||||
o.title = true
|
||||
o.hidden = true
|
||||
o.wildmenu = true
|
||||
o.showcmd = true
|
||||
o.showmatch = true
|
||||
o.inccommand = 'split'
|
||||
o.splitbelow = true -- open new vertical split bottom
|
||||
o.splitright = true -- open new horizontal split right
|
||||
o.smartindent = true
|
||||
o.wrap = false
|
||||
|
||||
-- Highlight search
|
||||
o.hlsearch = true
|
||||
o.incsearch = true
|
||||
|
||||
-- No vim backup files
|
||||
o.backup = false
|
||||
o.swapfile = false
|
||||
|
||||
-- Scrolling settings
|
||||
o.scrolloff = 8
|
||||
o.colorcolumn = '80'
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue