From 2af88e9c8673eec6b414aabaa1cc6ed787e61ead Mon Sep 17 00:00:00 2001 From: DMcP89 Date: Thu, 6 Jun 2024 21:08:35 -0400 Subject: [PATCH] Updated init.lua --- .config/nvim/init.lua | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) 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 ') + +