From 25e82208f132dcb4e5037c3ee9ff6c1814f06bbb Mon Sep 17 00:00:00 2001 From: mat ess Date: Thu, 10 Feb 2022 00:08:27 -0500 Subject: [PATCH] Add init.vim --- configs/init.vim | 75 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 configs/init.vim diff --git a/configs/init.vim b/configs/init.vim new file mode 100644 index 0000000..f0dcee4 --- /dev/null +++ b/configs/init.vim @@ -0,0 +1,75 @@ +syntax on +filetype plugin indent on +set cursorline "highlight current line +set showmatch "highlight matching [{()}] +set tabstop=2 "number of visual spaces per TAB when reading +set softtabstop=2 "number of spaces per TAB when editing +set expandtab "tabs are spaces +set shiftwidth=2 "indents +set ww=<,>,[,] "wrap +set splitbelow "split underneath +set splitright "split to the right + +command Mks NERDTreeClose | mksession! +command Term split | term +command Vterm vsplit | term + +"command Hsfmt mark H | %!./styler.sh | if v:shell_error | undo | else | `H | delm H | endif + +"save readonly +cmap w!! w !sudo tee >/dev/null % +"terminal exit +tnoremap +"nohl +nnoremap , :nohlsearch + +colorscheme Tomorrow-Night-Eighties + +let g:lightline = {'colorscheme': 'jellybeans'} + +"cursor saving +autocmd BufReadPost * if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif + +"nerdtree +"show hidden files +let NERDTreeShowHidden=1 +"open on vim open +"autocmd vimenter * NERDTree +"switch to editing window +"autocmd vimenter * wincmd p +"close if only nerdtree is left +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +"show/hide nerdtree +nnoremap :NERDTreeToggle + +"LSP support +"set hidden +"let g:LanguageClient_rootMarkers = ['*.cabal', 'stack.yaml'] +"let g:LanguageClient_serverCommands = { +" \ 'haskell': ['ghcide', '--lsp'], +" \ } +"let g:LanguageClient_preferredMarkupKind = ['plaintext'] +"let g:LanguageClient_completionPreferTextEdit = 1 +"nnoremap K :call LanguageClient#textDocument_hover() +"nnoremap f :call LanguageClient#textDocument_rangeFormatting() +"nnoremap F :call LanguageClient#textDocument_formatting() +"nnoremap gd :call LanguageClient#textDocument_definition() +"nnoremap gr :call LanguageClient#textDocument_references() +"set cmdheight=2 +"set updatetime=300 +"set signcolumn=yes +" +""NCM2 +"autocmd bufenter * call ncm2#enable_for_buffer() +"au User Ncm2PopupOpen set completeopt=noinsert,menuone,noselect +"au User Ncm2PopupClose set completeopt=menuone +"set shortmess+=c +"" CTRL-C doesn't trigger the InsertLeave autocmd . map to instead. +"inoremap +"" When the key is pressed while the popup menu is visible, it only +"" hides the menu. Use this mapping to close the menu and also start a new +"" line. +"inoremap (pumvisible() ? "\\" : "\") +"" Use to select the popup menu: +"inoremap pumvisible() ? "\" : "\" +"inoremap pumvisible() ? "\" : "\"