diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index feb4803..6d17aea 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,5 +1,16 @@ -- Set nocompatible vim.o.compatible = false +-- Plugins + +local vim = vim +local Plug = vim.fn['plug#'] + +vim.call('plug#begin') + +Plug('tpope/vim-fugitive') +Plug('fatih/vim-go') + +vim.call('plug#end') -- Colors vim.cmd('syntax enable') @@ -21,3 +32,39 @@ vim.o.shiftwidth = 4 -- >> or << commands shift lines 4 spaces vim.cmd('filetype indent on') -- load filetype-specific indent files +-- Buffer Management +vim.cmd('nnoremap :bnext') +vim.cmd('nnoremap :bprev') +vim.cmd('nnoremap :bd') + +-- Toggle serach highlight +vim.cmd('nnoremap h :nohlsearch') + +-- Folding Settings +vim.o.foldenable = true --enable folding +vim.o.foldlevelstart = 10 --open most folds by default +vim.o.foldnestmax = 10 -- 10 nested fold max +vim.ofoldmethod = indent +-- space open/closes folds +vim.cmd('nnoremap za') + +-- Search and Replace +vim.cmd('nnoremap r :%s///g') + + +-- Auto close brackets +vim.cmd('inoremap { {}ha') +vim.cmd('inoremap ( ()ha') +vim.cmd('inoremap [ []ha') +vim.cmd('inoremap " ""ha') +vim.cmd("inoremap ' ''ha") +vim.cmd('inoremap ` ``ha') + + +-- disable arrow keys +vim.cmd('noremap ') +vim.cmd('noremap ') +vim.cmd('noremap ') +vim.cmd('noremap ') + +