From 2d1191a092a26997d3b177d1d3f3a315cdd4a38e Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sun, 2 Apr 2023 22:20:09 -0600 Subject: another cool update --- vim/.vimrc | 52 +++++++++++++++++++++++++++++++++++++++++---------- vim/coc-settings.json | 45 ++++++++++++++++++++++++++++++++++++++------ 2 files changed, 81 insertions(+), 16 deletions(-) (limited to 'vim') diff --git a/vim/.vimrc b/vim/.vimrc index cd27085..1b43457 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -8,8 +8,8 @@ call plug#begin() Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'itchyny/lightline.vim' Plug 'jceb/vim-orgmode' - Plug 'tpope/vim-speeddating' - Plug 'ryanoasis/vim-devicons' + " Plug 'tpope/vim-speeddating' + Plug 'ryanoasis/vim-devicons' Plug 'tiagofumo/vim-nerdtree-syntax-highlight' Plug 'lervag/vimtex' Plug 'preservim/nerdtree' @@ -17,6 +17,8 @@ call plug#begin() Plug 'tpope/vim-commentary' Plug 'godlygeek/tabular' Plug 'preservim/vim-markdown' + " Plug 'Yggdroot/indentLine' + Plug 'junegunn/fzf.vim' call plug#end() @@ -28,20 +30,23 @@ set relativenumber set bg:dark set mouse=a set tabstop=2 softtabstop=2 shiftwidth=2 expandtab +set formatoptions-=t set linebreak set cursorline +" set cursorcolumn set backspace=indent,eol,start set laststatus=2 set wildmenu set scrolloff=5 set incsearch set ttimeout ttimeoutlen=25 -set showtabline=2 +" set showtabline=2 set undodir=~/.vim/undo-dir set undofile set backupdir=$HOME/.vim/backups set noshowmode set showcmd +" set termguicolors " set clipboard=unnamedplus " lets @@ -53,6 +58,7 @@ let g:python_recommended_style = 0 let g:NERDTreeFileExtensionHighlightFullName = 1 let g:NERDTreeExactMatchHighlightFullName = 1 let g:NERDTreePatternMatchHighlightFullName = 1 +let g:NERDTreeWinPos = 'right' let g:org_heading_shade_leading_stars = 0 let g:vim_markdown_folding_disabled = 1 let g:vim_markdown_new_list_item_indent = 2 @@ -60,8 +66,18 @@ let g:vim_markdown_new_list_item_indent = 2 " colorscheme stuff colorscheme gruvbox -" fix colorscheme colors +" set specific colors hi Normal ctermbg=NONE +hi Normal guibg=NONE +hi CocUnderline gui=undercurl cterm=underline +hi CocInfoHighlight cterm=underline +hi CocErrorHighlight ctermfg=red gui=underline cterm=underline +hi CocWarningHighlight ctermfg=yellow gui=underline cterm=underline +hi MatchParen cterm=bold ctermfg=cyan + +" Custom commands +command Fixtabs :%s/ / /g | echo 'tabs replaced with spaces (like a good programmer)' +command Clipboard :yank + | echo 'Yanked line into system clipboard' " remaps nnoremap @@ -72,14 +88,17 @@ nnoremap x :wq nnoremap b :e# nnoremap e :e nnoremap c gcc +nnoremap y :noh nnoremap u :tabp nnoremap o :tabn +nnoremap r :Clipboard nnoremap h :wincmd h nnoremap j :wincmd j nnoremap k :wincmd k nnoremap l :wincmd l nnoremap n :NERDTreeFocus nnoremap t :NERDTreeToggle +nnoremap f :Files . nnoremap p :wincmd p nnoremap v :set paste! number! relativenumber! nnoremap i :CocCommand clangd.switchSourceHeader @@ -93,13 +112,13 @@ autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTr " Close the tab if NERDTree is the only window remaining in it. autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif " Open the existing NERDTree on each new tab. -autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif +" autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif " turn on spell checker for certain files autocmd FileType markdown setlocal spell autocmd FileType org setlocal spell hi clear SpellBad -hi SpellBad cterm=underline ctermbg=DARKRED +hi SpellBad cterm=underline ctermfg=red hi clear SpellRare hi SpellRare cterm=underline hi clear SpellCap @@ -124,6 +143,17 @@ function! CheckBackspace() abort return !col || getline('.')[col - 1] =~# '\s' endfunction +function! HumanSize() abort + let l:bytes = line2byte('$') + len(getline('$')) + let l:sizes = ['B', 'KB', 'MB', 'GB'] + let l:i = 0 + while l:bytes >= 1024 + let l:bytes = l:bytes / 1024.0 + let l:i += 1 + endwhile + return printf('%.0f%s', l:bytes, l:sizes[l:i]) +endfunction + " lightline config if expand('$UID') == 0 let g:lightline = { @@ -133,11 +163,12 @@ if expand('$UID') == 0 \ [ 'filename', 'readonly', 'modified' ], \ [ 'gitbranch'] ], \ 'right': [ [ 'lineinfo' ], - \ [ 'fileformat', 'filetype' ], + \ [ 'filesize', 'fileformat', 'filetype' ], \ [ 'percent' ] ] \ }, \ 'component_function': { - \ 'gitbranch': 'gitbranch#name' + \ 'gitbranch': 'gitbranch#name', + \ 'filesize': 'HumanSize' \ }, \ } let g:lightline.component = { @@ -151,11 +182,12 @@ else \ [ 'filename', 'readonly', 'modified' ], \ [ 'gitbranch'] ], \ 'right': [ [ 'lineinfo' ], - \ [ 'fileformat', 'filetype' ], + \ [ 'filesize', 'fileformat', 'filetype' ], \ [ 'percent' ] ] \ }, \ 'component_function': { - \ 'gitbranch': 'gitbranch#name' + \ 'gitbranch': 'gitbranch#name', + \ 'filesize': 'HumanSize' \ }, \ } let g:lightline.component = { diff --git a/vim/coc-settings.json b/vim/coc-settings.json index 3fb81bc..1d2393a 100644 --- a/vim/coc-settings.json +++ b/vim/coc-settings.json @@ -1,11 +1,41 @@ { - "semanticTokens.filetypes": ["*"], + "semanticTokens.filetypes": ["*"], + "semanticTokens.enable": true, + "documentHighlight.priority": 2049, + "coc.preferences.enableMarkdown": false, "suggest.completionItemKindLabels": { - "text": "t", - "method": "m", - "function": "" + "text": "", + "method": "", + "function": "", + "constructor": "", + "field": "", + "variable": "", + "class": "", + "interface": "", + "module": "", + "property": "", + "unit": "", + "value": "", + "enum": "", + "keyword": "", + "snippet": "", + "color": "", + "file": "", + "reference": "", + "folder": "", + "enumMember": "", + "constant": "", + "struct": "", + "event": "", + "operator": "", + "typeParameter": "", + "default": "" }, - "java.home": "/usr/local/java/jdk-18.0.1.1", + "diagnostic.hintSign": "", + "diagnostic.infoSign": "", + "diagnostic.errorSign": "", + "diagnostic.warningSign": "", + "java.jdt.ls.java.home": "/usr/local/java/jdk-18.0.1.1", "java.configuration.runtimes": [ { "name": "JavaSE-18", @@ -16,12 +46,14 @@ "java.referencesCodeLens.enabled": true, "java.implementationsCodeLens.enabled": true, "java.completion.enabled": true, + "colors.enable": true, "perl": { "enable": true, "debugAdapterPort": "13604", "logLevel": 1 }, "java.jdt.ls.vmargs": "-noverify -Xmx6G -XX:+UseG1GC -XX:+UseStringDeduplication", + "java.project.referencedLibraries": ["*.jar"], "languageserver": { "csharp-ls": { "command": "csharp-ls", @@ -29,5 +61,6 @@ "rootPatterns": ["*.csproj", ".vim/", ".git/", ".hg/"] } }, - "suggest.noselect": true + "suggest.noselect": true, + "inlayHint.display": false } -- cgit v1.2.3