From a6674ca61de5b534b536b2aa07cd75a2f08c2904 Mon Sep 17 00:00:00 2001 From: Shawn Anderson Date: Wed, 17 May 2023 20:40:47 -0700 Subject: [PATCH] Update nvim. --- dotfiles/.config/nvim/autocommands.vim | 11 ++- dotfiles/.config/nvim/coc-settings.json | 4 +- dotfiles/.config/nvim/colors/bat.vim | 90 +++++++++++++++++++ dotfiles/.config/nvim/colors/quantum.vim | 6 +- dotfiles/.config/nvim/filetype.vim | 7 ++ dotfiles/.config/nvim/init.vim | 3 + dotfiles/.config/nvim/keys.vim | 34 +++++-- .../nvim/plugconfig/neoclide/coc.vim.vim | 6 +- .../plugconfig/preservim/nerdcommenter.vim | 2 + dotfiles/.config/nvim/plugins.vim | 54 +++++++++-- dotfiles/.config/nvim/settings.vim | 7 +- dotfiles/.config/nvim/themes.vim | 2 - 12 files changed, 196 insertions(+), 30 deletions(-) create mode 100644 dotfiles/.config/nvim/colors/bat.vim create mode 100644 dotfiles/.config/nvim/filetype.vim diff --git a/dotfiles/.config/nvim/autocommands.vim b/dotfiles/.config/nvim/autocommands.vim index ab11a0a..4a397fd 100644 --- a/dotfiles/.config/nvim/autocommands.vim +++ b/dotfiles/.config/nvim/autocommands.vim @@ -1,3 +1,8 @@ +augroup vyper_ft + au! + autocmd BufNewFile,BufRead *.vy set syntax=vyper +augroup END + " Set tabs for certain file types " for html and css js and vue autocmd FileType html setlocal ts=2 sw=2 expandtab @@ -28,8 +33,10 @@ autocmd BufWritePost config.h,config.def.h !sudo make install; make clean " Comile any latex document into pdf form autocmd BufWritePost answers.tex !pdflatex answers.tex -" Compile VIU markdown notes to pdf -autocmd BufWritePost notes.md !pandoc -s -o notes.pdf notes.md +" Compile markdown notes to pdf +" This is fucking cool but also requires a bunch on dependencies on popos. +" requires pandoc and texlive-latex-base +"autocmd BufWritePost notes.md !pandoc -s -o notes.pdf notes.md " clear empty spaces at the end of lines on save of python files "autocmd BufWritePre *.py :%s/\s\+$//e diff --git a/dotfiles/.config/nvim/coc-settings.json b/dotfiles/.config/nvim/coc-settings.json index 434011b..209607b 100644 --- a/dotfiles/.config/nvim/coc-settings.json +++ b/dotfiles/.config/nvim/coc-settings.json @@ -931,6 +931,7 @@ "description": "Set to false to disable snippets support.", "default": true }, + "coc.source.emoji.filetypes": ["markdown","python"], "coc.source.around.enable": { "type": "boolean", "default": true @@ -1059,6 +1060,7 @@ "sigint", "trainsets" ], - "clangd.path": "/home/matt/.config/coc/extensions/coc-clangd-data/install/10.0.0/clangd_10.0.0/bin/clangd" + "clangd.path": "/home/matt/.config/coc/extensions/coc-clangd-data/install/10.0.0/clangd_10.0.0/bin/clangd", + "snippets.ultisnips.pythonPrompt": false } diff --git a/dotfiles/.config/nvim/colors/bat.vim b/dotfiles/.config/nvim/colors/bat.vim new file mode 100644 index 0000000..ca5e37b --- /dev/null +++ b/dotfiles/.config/nvim/colors/bat.vim @@ -0,0 +1,90 @@ +" taken from bat: +let b:outer_space="#263238" " dark blue (background colour) +let b:spring_wood="#f8f8f0" " very light yellow +let b:sunshade="#fe8a26" " orange +let b:malibu="#62d6fd" " light blue +let b:pear="#a6e22e" " light green +let b:carnation="#f36464" " light red +let b:heliotrope="#be84ff" " light purple + +" other (taken from molokai): +let b:tundora="#444444" " dark gray +let b:mine_shaft="#373737" " very dark gray +let b:storm_dust="#60605e" " yet another shade of gray + +" customised: +let b:sirocco="#747e80" " gray (used for comments) +let b:yellow="#ffff00" " pure yellow + +set background=dark +highlight clear + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "bat" + +function! s:hi(name, fg, bg, gui) + execute 'hi' a:name "ctermfg=NONE" "ctermbg=NONE" ("guifg=".a:fg) ("guibg=".a:bg) ("gui=".a:gui) +endfunction + +call s:hi("Cursor", b:outer_space, b:spring_wood, "NONE") +call s:hi("Visual", "NONE", b:tundora, "NONE") +call s:hi("CursorLine", "NONE", b:mine_shaft, "NONE") +call s:hi("CursorColumn", "NONE", b:mine_shaft, "NONE") +call s:hi("ColorColumn", "NONE", b:mine_shaft, "NONE") +call s:hi("LineNr", b:sirocco, b:mine_shaft, "NONE") +call s:hi("VertSplit", b:storm_dust, b:storm_dust, "NONE") +call s:hi("MatchParen", b:malibu, "NONE", "underline") +call s:hi("StatusLine", b:spring_wood, b:storm_dust, "bold") +call s:hi("StatusLineNC", b:spring_wood, b:storm_dust, "NONE") +call s:hi("Pmenu", "white", b:tundora, "NONE") +call s:hi("PmenuSel", "NONE", b:outer_space, "NONE") +call s:hi("IncSearch", b:outer_space, b:yellow, "NONE") +call s:hi("Search", b:outer_space, b:yellow, "NONE") +call s:hi("Directory", b:heliotrope, "NONE", "NONE") +call s:hi("Folded", b:tundora, b:outer_space, "NONE") +call s:hi("Normal", b:spring_wood, b:outer_space, "NONE") +call s:hi("Boolean", b:heliotrope, "NONE", "NONE") +call s:hi("Character", b:heliotrope, "NONE", "NONE") +call s:hi("Comment", b:sirocco, "NONE", "NONE") +call s:hi("Conditional", b:carnation, "NONE", "NONE") +call s:hi("Constant", "NONE", "NONE", "NONE") +call s:hi("Define", b:malibu, "NONE", "NONE") +call s:hi("ErrorMsg", b:spring_wood, b:malibu, "NONE") +call s:hi("WarningMsg", b:spring_wood, b:malibu, "NONE") +call s:hi("Float", b:heliotrope, "NONE", "NONE") +call s:hi("Function", b:pear, "NONE", "NONE") +call s:hi("Identifier", b:sunshade, "NONE", "NONE") +call s:hi("Include", b:carnation, "NONE", "NONE") +call s:hi("Keyword", b:malibu, "NONE", "NONE") +call s:hi("Label", "#e6db74", "NONE", "NONE") +call s:hi("NonText", b:mine_shaft, b:outer_space, "NONE") +call s:hi("Number", b:heliotrope, "NONE", "NONE") +call s:hi("Operator", b:carnation, "NONE", "NONE") +call s:hi("PreProc", b:malibu, "NONE", "NONE") +call s:hi("TSProperty", "white", "NONE", "NONE") +call s:hi("Special", "#af87fc", "NONE", "NONE") +call s:hi("SpecialKey", b:mine_shaft, "NONE", "NONE") +call s:hi("Statement", b:carnation, "NONE", "NONE") +call s:hi("StorageClass", "#66d9ef", "NONE", "NONE") +call s:hi("String", "#ffd242", "NONE", "NONE") +call s:hi("Tag", b:malibu, "NONE", "NONE") +call s:hi("Title", b:spring_wood, "NONE", "bold") +call s:hi("Todo", "#75715e", "#8cd0de", "bold") +call s:hi("Type", b:pear, "NONE", "NONE") +call s:hi("Underlined", "NONE", "NONE", "underline") +call s:hi("DiffAdd", b:spring_wood, "#45820c", "bold") +call s:hi("DiffDelete", "#8a0707", "NONE", "NONE") +call s:hi("DiffChange", b:spring_wood, "#213655", "NONE") +call s:hi("DiffText", b:spring_wood, "#204a87", "bold") +" vim-go: +call s:hi("goReceiverVar", b:sunshade, "NONE", "NONE") +call s:hi("goParamName", b:sunshade, "NONE", "NONE") +call s:hi("goReceiverType", b:malibu, "NONE", "NONE") +call s:hi("goFunctionCall", b:spring_wood, "NONE", "NONE") +call s:hi("goVarDefs", b:spring_wood, "NONE", "NONE") +call s:hi("goVarAssign", b:spring_wood, "NONE", "NONE") +call s:hi("goBuiltins", b:malibu, "NONE", "NONE") + diff --git a/dotfiles/.config/nvim/colors/quantum.vim b/dotfiles/.config/nvim/colors/quantum.vim index edfb739..d560e34 100644 --- a/dotfiles/.config/nvim/colors/quantum.vim +++ b/dotfiles/.config/nvim/colors/quantum.vim @@ -16,8 +16,8 @@ let g:quantum_black = get(g:, 'quantum_black', 0) " Color Palette let s:gray1 = g:quantum_black ? '#000000' : '#000' -let s:gray2 = g:quantum_black ? '#292929' : '#2c3a41' -let s:gray3 = g:quantum_black ? '#474646' : '#425762' +let s:gray2 = g:quantum_black ? '#393939' : '#2c3a41' +let s:gray3 = g:quantum_black ? '#565656' : '#425762' let s:gray4 = g:quantum_black ? '#6a6c6c' : '#658494' let s:gray5 = g:quantum_black ? '#b7bdc0' : '#aebbc5' let s:red = '#dd7186' @@ -85,7 +85,7 @@ call s:HL('TabLineSel', s:yellow, s:gray3, 'none') call s:HL('Title', s:green, '', 'none') call s:HL('VertSplit', s:gray4, s:gray1, 'none') call s:HL('Visual', s:gray5, s:gray3, '') -call s:HL('WarningMsg', s:red, '', '') +call s:HL('WarningMsg', s:red, '', 'bold') call s:HL('WildMenu', s:gray2, s:cyan, '') " Standard Syntax diff --git a/dotfiles/.config/nvim/filetype.vim b/dotfiles/.config/nvim/filetype.vim new file mode 100644 index 0000000..ba010f3 --- /dev/null +++ b/dotfiles/.config/nvim/filetype.vim @@ -0,0 +1,7 @@ +" my filetype file +if exists("did_load_filetypes") + finish +endif +augroup filetypedetect + au! BufRead,BufNewFile *.vy setfiletype python +augroup END diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim index 9bcf6f2..183b97c 100644 --- a/dotfiles/.config/nvim/init.vim +++ b/dotfiles/.config/nvim/init.vim @@ -46,3 +46,6 @@ nnoremap :set cursorline :set number :set relativenumber! +:set autoread + +let g:coc_global_extensions = ['coc-json', 'coc-git', 'coc-tsserver', 'coc-pyright', 'coc-solidity'] diff --git a/dotfiles/.config/nvim/keys.vim b/dotfiles/.config/nvim/keys.vim index 215c58d..9bdfd6f 100644 --- a/dotfiles/.config/nvim/keys.vim +++ b/dotfiles/.config/nvim/keys.vim @@ -27,19 +27,35 @@ vnoremap P "+P " tab navigation mappings -map tt :tabnew -map :tabn -imap :tabn -map :tabp -imap :tabp -map :tabn -imap :tabn -map :tabp -imap :tabp + +" New tab +map :tabnew +imap :tabnew + +" Close tab +map :tabclose +imap :tabclose + +" Move Right +map :tabn +imap :tabn +map :tabn +imap :tabn + +" Move Left +map :tabp +imap :tabp +map :tabp +imap :tabp " clear search results nnoremap // :noh +" FZF Searches +nnoremap :History +nnoremap :Buffers +nnoremap :GGrep + diff --git a/dotfiles/.config/nvim/plugconfig/neoclide/coc.vim.vim b/dotfiles/.config/nvim/plugconfig/neoclide/coc.vim.vim index 5d633e5..9cfef09 100644 --- a/dotfiles/.config/nvim/plugconfig/neoclide/coc.vim.vim +++ b/dotfiles/.config/nvim/plugconfig/neoclide/coc.vim.vim @@ -33,7 +33,7 @@ function! s:check_back_space() abort endfunction inoremap \ pumvisible() ? "\" : - \ check_back_space() ? "\" : + "\ check_back_space() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\" @@ -57,7 +57,7 @@ nmap gi (coc-implementation) nmap gr (coc-references) " Use K to show documentation in preview window -"nnoremap K :call show_documentation() +nnoremap K :call show_documentation() function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) @@ -137,7 +137,7 @@ function! StatusDiagnostic() abort endfunction " Disable node version warning -let g:coc_disable_startup_warning = 1 +let g:coc_disable_startup_warning = 0 " Vim script coc extension let g:markdown_fenced_languages = [ diff --git a/dotfiles/.config/nvim/plugconfig/preservim/nerdcommenter.vim b/dotfiles/.config/nvim/plugconfig/preservim/nerdcommenter.vim index 6e0d79e..6e97991 100644 --- a/dotfiles/.config/nvim/plugconfig/preservim/nerdcommenter.vim +++ b/dotfiles/.config/nvim/plugconfig/preservim/nerdcommenter.vim @@ -1,2 +1,4 @@ +let g:NERDCustomDelimiters = {'javascript': { 'left': '//', 'right': '', 'leftAlt': '{/* ', 'rightAlt': ' */}' }, 'vyper': { 'left': '# ', 'right': '' }} Plug 'preservim/nerdcommenter' " quick commenter +" diff --git a/dotfiles/.config/nvim/plugins.vim b/dotfiles/.config/nvim/plugins.vim index 2855765..a4d6f43 100644 --- a/dotfiles/.config/nvim/plugins.vim +++ b/dotfiles/.config/nvim/plugins.vim @@ -154,14 +154,37 @@ Plug 'neomake/neomake' " Nice icons: Need to install patched font for this to work Plug 'ryanoasis/vim-devicons' -" This is solves a bug in devicons that appears when sourcing vimrc -if exists("g:loaded_webdevicons") - call webdevicons#refresh() -endif + " Devicon Configurations " loading the plugin let g:webdevicons_enable = 1 +" This is solves a bug in devicons that appears when sourcing vimrc +if !exists('g:syntax_on') + syntax enable +endif +if exists("g:loaded_webdevicons") + call webdevicons#refresh() +endif + +let g:webdevicons_enable_nerdtree = 1 + +" let g:NERDTreeHighlightFolders = 1 +let g:NERDTreeHighlightFoldersFullName = 1 +let g:WebDevIconsUnicodeDecorateFolderNodes = 1 " enable folder glyph flag +let g:DevIconsEnableFoldersOpenClose = 1 +let g:DevIconsEnableFolderExtensionPatternMatching = 1 +let g:webdevicons_conceal_nerdtree_brackets = 1 + +" Basically disable nerdtree markers +let g:NERDTreeDirArrowExpandable = ' ' +let g:NERDTreeDirArrowCollapsible = ' ' + +let g:WebDevIconsUnicodeDecorateFolderNodesDefaultSymbol = ' ' +let g:DevIconsDefaultFolderOpenSymbol = ' ' + + + " add or override individual additional filetypes @@ -179,16 +202,25 @@ Plug 'junegunn/goyo.vim' " Goyo mappings nmap :Goyo + " Slimux -Plug 'esamattis/slimux' +Plug 'lotabout/slimux' map :SlimuxREPLSendLinej vmap :SlimuxREPLSendSelection Plug 'pangloss/vim-javascript' -Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } +"Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } -Plug 'neoclide/coc.nvim', {'branch': 'release'} +"Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}} +Plug 'neoclide/coc-snippets', {'do': 'yarn install --frozen-lockfile'} +Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'} +Plug 'neoclide/coc-prettier', {'do': 'yarn install --frozen-lockfile'} +Plug 'neoclide/coc-eslint', {'do': 'yarn install --frozen-lockfile'} +Plug 'neoclide/coc-css', {'do': 'yarn install --frozen-lockfile'} +Plug 'neoclide/coc-lists', {'do': 'yarn install --frozen-lockfile'} " mru and stuff +Plug 'neoclide/coc-highlight', {'do': 'yarn install --frozen-lockfile'} " color highlighting Plug 'neoclide/jsonc.vim' @@ -198,6 +230,14 @@ Plug 'vimwiki/vimwiki' Plug 'bfredl/nvim-ipy' +Plug 'vyperlang/vim-vyper' + +Plug 'jmcantrell/vim-virtualenv' + +Plug 'mkitt/tabline.vim' + +Plug 'prisma/vim-prisma' + " Tell vim-plug we finished declaring plugins, so it can load them call plug#end() diff --git a/dotfiles/.config/nvim/settings.vim b/dotfiles/.config/nvim/settings.vim index f053191..03758cc 100644 --- a/dotfiles/.config/nvim/settings.vim +++ b/dotfiles/.config/nvim/settings.vim @@ -7,15 +7,16 @@ set tags=tags " ------------------------------------------------------------------------------ " These are inherited from MattCoding4Days "" Make vim scroll faster -set ttyfast +set ttyfast " Removed in Nvim " set mouse=a set lazyredraw set nu set nowrap set relativenumber set encoding=UTF-8 -" set tabline to not display full path -set guitablabel=%t +" set tabline to (not) display full path +set guitablabel=%F +set showtabline=2 " tabs and spaces handling set expandtab diff --git a/dotfiles/.config/nvim/themes.vim b/dotfiles/.config/nvim/themes.vim index a1e9ce4..cc6f5ca 100644 --- a/dotfiles/.config/nvim/themes.vim +++ b/dotfiles/.config/nvim/themes.vim @@ -19,5 +19,3 @@ if (&term =~? 'mlterm\|xterm\|xterm-256\|screen-256') || has('nvim') else colorscheme jellybeans endif - -