summaryrefslogtreecommitdiff
path: root/.config/nvim/init.vim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/init.vim')
-rw-r--r--.config/nvim/init.vim81
1 files changed, 81 insertions, 0 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
new file mode 100644
index 0000000..5cba9a4
--- /dev/null
+++ b/.config/nvim/init.vim
@@ -0,0 +1,81 @@
+if &compatible
+ set nocompatible
+endif
+filetype plugin on
+filetype indent on
+syntax on
+
+set number
+set relativenumber
+let g:netrw_banner = v:false
+set title
+set nohlsearch
+set noincsearch
+set laststatus=2
+
+set background=dark
+augroup CustomizeColorScheme
+ autocmd!
+ autocmd ColorScheme,VimEnter * highlight Normal ctermbg=NONE guibg=NONE
+augroup END
+silent! colorscheme wildcharm
+
+set list
+set listchars=tab:..,trail:_,extends:>,precedes:<,nbsp:~
+
+set scrolloff=5
+set splitbelow
+set splitright
+
+set path+=**
+set completeopt=menu,menuone,popup,fuzzy
+set ignorecase
+
+set undofile
+set undolevels=10000
+
+let g:mapleader = ' '
+nnoremap <Leader>s :setlocal spell!<CR>
+nnoremap <C-p> :e **/*
+
+"if has('nvim-0.11')
+" if executable('clangd')
+" lua vim.lsp.enable('clangd')
+" endif
+" if executable('gopls')
+" lua vim.lsp.enable('gopls')
+" endif
+"endif
+
+if has('nvim')
+ augroup StartTreesitter
+ autocmd!
+ autocmd FileType * lua pcall(vim.treesitter.start)
+ augroup END
+endif
+
+inoremap (;<CR> (<CR>);<C-c>O
+inoremap (<CR> (<CR>)<C-c>O
+inoremap [;<CR> [<CR>];<C-c>O
+inoremap [<CR> [<CR>]<C-c>O
+inoremap {;<CR> {<CR>};<C-c>O
+inoremap {<CR> {<CR>}<C-c>O
+inoremap " ""<Left>
+inoremap ' ''<Left>
+
+function! s:CreateAbbrs(ft) abort
+ for a in glob(split(&rtp, ',')[0] .. '/abbr/' .. a:ft .. '/*', 0, 1)
+ execute 'iabbrev <buffer> ' .. fnamemodify(a, ':t:r') .. ' <C-o>:-1read ' .. a .. '<CR>'
+ endfor
+endfunction
+command! -nargs=1 CreateAbbrs call s:CreateAbbrs(<f-args>)
+inoremap <C-f> <C-o>/@<CR><C-o>x
+inoremap <C-b> <C-o>?@<CR><C-o>x
+
+augroup AutoCreateAbbrs
+ autocmd!
+ for a in glob(split(&rtp, ',')[0] .. '/abbr/*', 0, 1)
+ let ft = fnamemodify(a, ':t:r')
+ execute 'autocmd FileType ' .. ft .. ' CreateAbbrs ' .. ft
+ endfor
+augroup END