From f819e30b03dffcf9e74af4b8552e4a8ab8f54c58 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Fri, 29 Sep 2023 14:22:24 -0400 Subject: major reorganizing to seperate modules --- modules/editor/neovim/init.vim | 71 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 modules/editor/neovim/init.vim (limited to 'modules/editor/neovim/init.vim') 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 = "\" + +" Tab-trigger completion +inoremap + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\" : + \ coc#refresh() +inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" + +inoremap coc#pum#visible() ? coc#pum#confirm() : + \ "\u\\=coc#on_enter()\" + +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +inoremap coc#refresh() + +nmap [g (coc-diagnostic-prev) +nmap ]g (coc-diagnostic-next) + +nmap gd (coc-definition) +nmap gy (coc-type-definition) +nmap gi (coc-implementation) +nmap gr (coc-references) + +nnoremap K :call ShowDocumentation() + +function! ShowDocumentation() + if CocAction('hasProvider', 'hover') + call CocActionAsync('doHover') + else + call feedkeys('K', 'in') + endif +endfunction + +autocmd CursorHold * silent call CocActionAsync('highlight') + +" Telescope +nnoremap ff Telescope find_files +nnoremap fg Telescope live_grep +nnoremap fb Telescope buffers +nnoremap fh help_tags + +lua require('init') + +color catppuccin -- cgit v1.2.1