Skip to content

Commit

Permalink
Updated init.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
DMcP89 committed Jun 7, 2024
1 parent ec44b4b commit 2af88e9
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -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 <C-L> :bnext<CR>')
vim.cmd('nnoremap <C-H> :bprev<CR>')
vim.cmd('nnoremap <C-x> :bd<CR>')

-- Toggle serach highlight
vim.cmd('nnoremap <Leader>h :nohlsearch<CR>')

-- 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 <space> za')

-- Search and Replace
vim.cmd('nnoremap <Leader>r :%s/<C-r><C-w>//g<Left><Left>')


-- Auto close brackets
vim.cmd('inoremap { {}<Esc>ha')
vim.cmd('inoremap ( ()<Esc>ha')
vim.cmd('inoremap [ []<Esc>ha')
vim.cmd('inoremap " ""<Esc>ha')
vim.cmd("inoremap ' ''<Esc>ha")
vim.cmd('inoremap ` ``<Esc>ha')


-- disable arrow keys
vim.cmd('noremap <Up> <Nop>')
vim.cmd('noremap <Down> <Nop>')
vim.cmd('noremap <Left> <Nop>')
vim.cmd('noremap <Right> <Nop>')


0 comments on commit 2af88e9

Please sign in to comment.