diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2023-09-29 14:22:24 -0400 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2023-09-29 14:22:24 -0400 |
commit | f819e30b03dffcf9e74af4b8552e4a8ab8f54c58 (patch) | |
tree | c05f4f1db738d6cd9d2824b5000c6afc3b1d61d1 /modules/editor/neovim/init.vim | |
parent | d3bb6cbb4724bc8f18f72fa3fea3e65f73ae8d09 (diff) | |
download | nix-config-f819e30b03dffcf9e74af4b8552e4a8ab8f54c58.tar.gz nix-config-f819e30b03dffcf9e74af4b8552e4a8ab8f54c58.tar.bz2 nix-config-f819e30b03dffcf9e74af4b8552e4a8ab8f54c58.zip |
major reorganizing to seperate modules
Diffstat (limited to 'modules/editor/neovim/init.vim')
-rw-r--r-- | modules/editor/neovim/init.vim | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/modules/editor/neovim/init.vim b/modules/editor/neovim/init.vim new file mode 100644 index 0000000..993ea88 --- /dev/null +++ b/modules/editor/neovim/init.vim @@ -0,0 +1,71 @@ +set termguicolors + +filetype plugin indent on +set tabstop=4 softtabstop=4 shiftwidth=4 +set expandtab smarttab +set autoindent +set incsearch ignorecase smartcase hlsearch +set encoding=utf-8 +set textwidth=0 +set number + +set hidden +set title +set noshowmode +set noruler +set noshowcmd + +set nobackup +set nowritebackup + +set updatetime=300 +set signcolumn=yes + +let mapleader = "\<Space>" + +" Tab-trigger completion +inoremap <silent><expr> <Tab> + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\<Tab>" : + \ coc#refresh() +inoremap <expr><S-Tab> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>" + +inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : + \ "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>" + +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +inoremap <silent><expr> <c-space> coc#refresh() + +nmap <silent> [g <Plug>(coc-diagnostic-prev) +nmap <silent> ]g <Plug>(coc-diagnostic-next) + +nmap <silent> gd <Plug>(coc-definition) +nmap <silent> gy <Plug>(coc-type-definition) +nmap <silent> gi <Plug>(coc-implementation) +nmap <silent> gr <Plug>(coc-references) + +nnoremap <silent> K :call ShowDocumentation()<CR> + +function! ShowDocumentation() + if CocAction('hasProvider', 'hover') + call CocActionAsync('doHover') + else + call feedkeys('K', 'in') + endif +endfunction + +autocmd CursorHold * silent call CocActionAsync('highlight') + +" Telescope +nnoremap <leader>ff <cmd>Telescope find_files<cr> +nnoremap <leader>fg <cmd>Telescope live_grep<cr> +nnoremap <leader>fb <cmd>Telescope buffers<cr> +nnoremap <leader>fh help_tags<cr> + +lua require('init') + +color catppuccin |