From 8c7703d72e3b554a95f9f6a4e612a8a748f19bac Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 7 Aug 2020 23:20:01 -0400 Subject: cleanup --- .gitignore | 1 + README.md | 6 ++- general/functions.vim | 2 + general/settings.vim | 87 +++++++++++++++++++++--------------------- init.vim | 82 ++++++++++++++++++---------------------- keys/mappings.vim | 102 +++++++++++++++++++++++--------------------------- keys/which-key.vim | 2 + utils/tasks.ini | 13 ++++++- vim-plug/plugins.vim | 6 ++- vscode/windows.vim | 67 --------------------------------- 10 files changed, 150 insertions(+), 218 deletions(-) delete mode 100644 vscode/windows.vim diff --git a/.gitignore b/.gitignore index ac7b0a79..97681c74 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ tags* pythonpath.vim nodepath.vim autoload/plugged/* +vimspector-config/* paths.vim session wiki/ diff --git a/README.md b/README.md index 659a3cfc..2b4c5227 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,8 @@ TabNine::config - native lsp - treesitter -## VSCode integration +## Things to look into -We will be integrating with VSCode using [this](https://github.com/asvetliakov/vscode-neovim) +**Python** +https://realpython.com/python-debugging-pdb/ " breakpoint syntax is really cool +also look into profiling as well diff --git a/general/functions.vim b/general/functions.vim index 47284f2e..0860b920 100644 --- a/general/functions.vim +++ b/general/functions.vim @@ -1,3 +1,5 @@ +" Random Useful Functions + " Turn spellcheck on for markdown files augroup auto_spellcheck autocmd BufNewFile,BufRead *.md setlocal spell diff --git a/general/settings.vim b/general/settings.vim index 3124eb75..b2910931 100644 --- a/general/settings.vim +++ b/general/settings.vim @@ -1,52 +1,49 @@ set iskeyword+=- " treat dash separated words as a word text object" set formatoptions-=cro " Stop newline continution of comments -if !exists('g:vscode') - syntax enable " Enables syntax highlighing - set hidden " Required to keep multiple buffers open multiple buffers - set nowrap " Display long lines as just one line - set encoding=utf-8 " The encoding displayed - set pumheight=10 " Makes popup menu smaller - set fileencoding=utf-8 " The encoding written to file - set ruler " Show the cursor position all the time - set cmdheight=2 " More space for displaying messages - set mouse=a " Enable your mouse - set splitbelow " Horizontal splits will automatically be below - set splitright " Vertical splits will automatically be to the right - set t_Co=256 " Support 256 colors - set conceallevel=0 " So that I can see `` in markdown files - set tabstop=2 " Insert 2 spaces for a tab - set shiftwidth=2 " Change the number of space characters inserted for indentation - set smarttab " Makes tabbing smarter will realize you have 2 vs 4 - set expandtab " Converts tabs to spaces - set smartindent " Makes indenting smart - set autoindent " Good auto indent - set laststatus=2 " Always display the status line - set number " Line numbers - set cursorline " Enable highlighting of the current line - set background=dark " tell vim what the background color looks like - set showtabline=2 " Always show tabs - set noshowmode " We don't need to see things like -- INSERT -- anymore - set nobackup " This is recommended by coc - set nowritebackup " This is recommended by coc - set shortmess+=c " Don't pass messages to |ins-completion-menu|. - set signcolumn=yes " Always show the signcolumn, otherwise it would shift the text each time - set updatetime=300 " Faster completion - set timeoutlen=100 " By default timeoutlen is 1000 ms - set clipboard=unnamedplus " Copy paste between vim and everything else - set incsearch - set guifont=Fira\ Code\ Nerd\ Font - " let $NVIM_TUI_ENABLE_TRUE_COLOR=1 - " set mmp=1300 - " set autochdir " Your working directory will always be the same as your working directory - " set foldcolumn=2 " Folding abilities +syntax enable " Enables syntax highlighing +set hidden " Required to keep multiple buffers open multiple buffers +set nowrap " Display long lines as just one line +set encoding=utf-8 " The encoding displayed +set pumheight=10 " Makes popup menu smaller +set fileencoding=utf-8 " The encoding written to file +set ruler " Show the cursor position all the time +set cmdheight=2 " More space for displaying messages +set mouse=a " Enable your mouse +set splitbelow " Horizontal splits will automatically be below +set splitright " Vertical splits will automatically be to the right +set t_Co=256 " Support 256 colors +set conceallevel=0 " So that I can see `` in markdown files +set tabstop=2 " Insert 2 spaces for a tab +set shiftwidth=2 " Change the number of space characters inserted for indentation +set smarttab " Makes tabbing smarter will realize you have 2 vs 4 +set expandtab " Converts tabs to spaces +set smartindent " Makes indenting smart +set autoindent " Good auto indent +set laststatus=2 " Always display the status line +set number " Line numbers +set cursorline " Enable highlighting of the current line +set background=dark " tell vim what the background color looks like +set showtabline=2 " Always show tabs +set noshowmode " We don't need to see things like -- INSERT -- anymore +set nobackup " This is recommended by coc +set nowritebackup " This is recommended by coc +set shortmess+=c " Don't pass messages to |ins-completion-menu|. +set signcolumn=yes " Always show the signcolumn, otherwise it would shift the text each time +set updatetime=300 " Faster completion +set timeoutlen=100 " By default timeoutlen is 1000 ms +set clipboard=unnamedplus " Copy paste between vim and everything else +set incsearch +set guifont=Fira\ Code\ Nerd\ Font +" let $NVIM_TUI_ENABLE_TRUE_COLOR=1 +" set mmp=1300 +" set autochdir " Your working directory will always be the same as your working directory +" set foldcolumn=2 " Folding abilities - " au! BufWritePost $MYVIMRC source % " auto source when writing to init.vm alternatively you can run :source $MYVIMRC - autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o +" au! BufWritePost $MYVIMRC source % " auto source when writing to init.vm alternatively you can run :source $MYVIMRC +autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o - - " You can't stop me - cmap w!! w !sudo tee % -endif +" You can't stop me +cmap w!! w !sudo tee % diff --git a/init.vim b/init.vim index dc0a9309..1033db10 100644 --- a/init.vim +++ b/init.vim @@ -5,62 +5,52 @@ "/___/_/ /_/_/\__(_)___/_/_/ /_/ /_/ -" Always source these +" General Settings source $HOME/.config/nvim/vim-plug/plugins.vim source $HOME/.config/nvim/general/settings.vim source $HOME/.config/nvim/general/functions.vim source $HOME/.config/nvim/keys/mappings.vim source $HOME/.config/nvim/keys/which-key.vim -" Source depending on if VSCode is our client -if exists('g:vscode') - " VSCode extension - source $HOME/.config/nvim/vscode/windows.vim - source $HOME/.config/nvim/plug-config/easymotion.vim -else - " ordinary neovim - source $HOME/.config/nvim/themes/syntax.vim - source $HOME/.config/nvim/themes/onedark.vim - source $HOME/.config/nvim/themes/airline.vim - source $HOME/.config/nvim/plug-config/rnvimr.vim - source $HOME/.config/nvim/plug-config/fzf.vim - source $HOME/.config/nvim/plug-config/vim-commentary.vim - source $HOME/.config/nvim/plug-config/rainbow.vim - source $HOME/.config/nvim/plug-config/codi.vim - source $HOME/.config/nvim/plug-config/quickscope.vim - source $HOME/.config/nvim/plug-config/vim-wiki.vim - source $HOME/.config/nvim/plug-config/sneak.vim - source $HOME/.config/nvim/plug-config/coc.vim - source $HOME/.config/nvim/plug-config/goyo.vim - source $HOME/.config/nvim/plug-config/vim-rooter.vim - source $HOME/.config/nvim/plug-config/start-screen.vim - source $HOME/.config/nvim/plug-config/gitgutter.vim - source $HOME/.config/nvim/plug-config/closetags.vim - source $HOME/.config/nvim/plug-config/floaterm.vim - source $HOME/.config/nvim/plug-config/vista.vim - source $HOME/.config/nvim/plug-config/xtabline.vim - source $HOME/.config/nvim/plug-config/polyglot.vim - source $HOME/.config/nvim/plug-config/far.vim - source $HOME/.config/nvim/plug-config/tagalong.vim - source $HOME/.config/nvim/plug-config/illuminate.vim - source $HOME/.config/nvim/plug-config/bracey.vim - source $HOME/.config/nvim/plug-config/asynctask.vim - source $HOME/.config/nvim/plug-config/window-swap.vim - source $HOME/.config/nvim/plug-config/markdown-preview.vim - luafile $HOME/.config/nvim/lua/plug-colorizer.lua -endif - +" Themes +source $HOME/.config/nvim/themes/syntax.vim +source $HOME/.config/nvim/themes/onedark.vim +source $HOME/.config/nvim/themes/airline.vim + +" Plugin Configuration +source $HOME/.config/nvim/plug-config/rnvimr.vim +source $HOME/.config/nvim/plug-config/fzf.vim +source $HOME/.config/nvim/plug-config/vim-commentary.vim +source $HOME/.config/nvim/plug-config/rainbow.vim +source $HOME/.config/nvim/plug-config/codi.vim +source $HOME/.config/nvim/plug-config/quickscope.vim +source $HOME/.config/nvim/plug-config/vim-wiki.vim +source $HOME/.config/nvim/plug-config/sneak.vim +source $HOME/.config/nvim/plug-config/coc.vim +source $HOME/.config/nvim/plug-config/goyo.vim +source $HOME/.config/nvim/plug-config/vim-rooter.vim +source $HOME/.config/nvim/plug-config/start-screen.vim +source $HOME/.config/nvim/plug-config/gitgutter.vim +source $HOME/.config/nvim/plug-config/closetags.vim +source $HOME/.config/nvim/plug-config/floaterm.vim +source $HOME/.config/nvim/plug-config/vista.vim +source $HOME/.config/nvim/plug-config/xtabline.vim +source $HOME/.config/nvim/plug-config/polyglot.vim +source $HOME/.config/nvim/plug-config/far.vim +source $HOME/.config/nvim/plug-config/tagalong.vim +source $HOME/.config/nvim/plug-config/illuminate.vim +source $HOME/.config/nvim/plug-config/bracey.vim +source $HOME/.config/nvim/plug-config/asynctask.vim +source $HOME/.config/nvim/plug-config/window-swap.vim +source $HOME/.config/nvim/plug-config/markdown-preview.vim +luafile $HOME/.config/nvim/lua/plug-colorizer.lua + +" Add paths to node and python here if !empty(glob("~/.config/nvim/paths.vim")) source $HOME/.config/nvim/paths.vim endif " Experimental - -" Python -" https://realpython.com/python-debugging-pdb/ " breakpoint syntax is really cool -" also look into profiling as well - -" let g:vimspector_base_dir=expand( '$HOME/.config/nvim/vimspector-config' ) +let g:vimspector_base_dir=expand( '$HOME/.config/nvim/vimspector-config' ) " let g:vimspector_enable_mappings='HUMAN' -" let g:spaceline_colorscheme = 'one' diff --git a/keys/mappings.vim b/keys/mappings.vim index 94db7ddb..0ae118d0 100644 --- a/keys/mappings.vim +++ b/keys/mappings.vim @@ -1,3 +1,4 @@ +" Basic Key Mappings imap h imap j @@ -12,67 +13,58 @@ nnoremap vnoremap < >gv -if exists('g:vscode') +" Better nav for omnicomplete +inoremap ("\") +inoremap ("\") -" Simulate same TAB behavior in VSCode -nmap :Tabnext -nmap :Tabprev +" I hate escape more than anything else +inoremap jk +inoremap kj -else - " Better nav for omnicomplete - inoremap ("\") - inoremap ("\") +" Easy CAPS +" inoremap viwUi +" nnoremap viwU - " I hate escape more than anything else - inoremap jk - inoremap kj +" TAB in general mode will move to text buffer +nnoremap :bnext +" SHIFT-TAB will go back +nnoremap :bprevious - " Easy CAPS - " inoremap viwUi - " nnoremap viwU +" Move selected line / block of text in visual mode +" shift + k to move up +" shift + j to move down +xnoremap K :move '<-2gv-gv +xnoremap J :move '>+1gv-gv - " TAB in general mode will move to text buffer - nnoremap :bnext - " SHIFT-TAB will go back - nnoremap :bprevious +" Alternate way to save +nnoremap :w +" Alternate way to quit +nnoremap :wq! +" Use control-c instead of escape +nnoremap +" : completion. +inoremap pumvisible() ? "\" : "\" - " Move selected line / block of text in visual mode - " shift + k to move up - " shift + j to move down - xnoremap K :move '<-2gv-gv - xnoremap J :move '>+1gv-gv +" Better window navigation +nnoremap h +nnoremap j +nnoremap k +nnoremap l - " Alternate way to save - nnoremap :w - " Alternate way to quit - nnoremap :wq! - " Use control-c instead of escape - nnoremap - " : completion. - inoremap pumvisible() ? "\" : "\" +" Terminal window navigation +tnoremap h +tnoremap j +tnoremap k +tnoremap l +inoremap h +inoremap j +inoremap k +inoremap l +tnoremap - - " Better window navigation - nnoremap h - nnoremap j - nnoremap k - nnoremap l - - " Terminal window navigation - tnoremap h - tnoremap j - tnoremap k - tnoremap l - inoremap h - inoremap j - inoremap k - inoremap l - tnoremap - - " Use alt + hjkl to resize windows - nnoremap :resize -2 - nnoremap :resize +2 - nnoremap :vertical resize -2 - nnoremap :vertical resize +2 -endif +" Use alt + hjkl to resize windows +nnoremap :resize -2 +nnoremap :resize +2 +nnoremap :vertical resize -2 +nnoremap :vertical resize +2 diff --git a/keys/which-key.vim b/keys/which-key.vim index 52ee1f0d..110594d0 100644 --- a/keys/which-key.vim +++ b/keys/which-key.vim @@ -1,3 +1,5 @@ +" Leader Key Maps + " Map leader to which_key nnoremap :silent :silent WhichKey '' vnoremap :silent :silent WhichKeyVisual '' diff --git a/utils/tasks.ini b/utils/tasks.ini index 31daa6d2..5a9e83b8 100644 --- a/utils/tasks.ini +++ b/utils/tasks.ini @@ -1,6 +1,6 @@ [file-compile] -command:javac="$(VIM_FILEPATH)" +command:java=javac "$(VIM_FILEPATH)" output=terminal cwd=$(VIM_FILEDIR) @@ -32,4 +32,13 @@ cwd=$(VIM_FILEDIR) save=2 [project-run] -command:javascript,css,jsx="npm start" +command:javascript,css,jsx=npm start +output=terminal +cwd=$(VIM_FILEDIR) +save=2 + +[gatsby-run] +command=gatsby develop +output=terminal +cwd=$(VIM_FILEDIR) +save=2 diff --git a/vim-plug/plugins.vim b/vim-plug/plugins.vim index db0458e3..9146fc58 100644 --- a/vim-plug/plugins.vim +++ b/vim-plug/plugins.vim @@ -97,7 +97,7 @@ call plug#begin('~/.config/nvim/autoload/plugged') Plug 'HerringtonDarkholme/yats.vim' " Smooth scroll Plug 'psliwka/vim-smoothie' - " asynt tasks + " async tasks Plug 'skywind3000/asynctasks.vim' Plug 'skywind3000/asyncrun.vim' " Swap windows @@ -106,6 +106,10 @@ call plug#begin('~/.config/nvim/autoload/plugged') Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & npm install' } " Better Whitespace Plug 'ntpeters/vim-better-whitespace' + " Multiple Cursors + Plug 'terryma/vim-multiple-cursors' + " Async Linting Engine + Plug 'dense-analysis/ale' " Plugin Graveyard " Plug 'kaicataldo/material.vim' " Plug 'NLKNguyen/papercolor-theme' diff --git a/vscode/windows.vim b/vscode/windows.vim deleted file mode 100644 index 436bf981..00000000 --- a/vscode/windows.vim +++ /dev/null @@ -1,67 +0,0 @@ - -"VSCode -function! s:split(...) abort - let direction = a:1 - let file = a:2 - call VSCodeCall(direction == 'h' ? 'workbench.action.splitEditorDown' : 'workbench.action.splitEditorRight') - if file != '' - call VSCodeExtensionNotify('open-file', expand(file), 'all') - endif -endfunction - -function! s:splitNew(...) - let file = a:2 - call s:split(a:1, file == '' ? '__vscode_new__' : file) -endfunction - -function! s:closeOtherEditors() - call VSCodeNotify('workbench.action.closeEditorsInOtherGroups') - call VSCodeNotify('workbench.action.closeOtherEditors') -endfunction - -function! s:manageEditorSize(...) - let count = a:1 - let to = a:2 - for i in range(1, count ? count : 1) - call VSCodeNotify(to == 'increase' ? 'workbench.action.increaseViewSize' : 'workbench.action.decreaseViewSize') - endfor -endfunction - -command! -complete=file -nargs=? Split call split('h', ) -command! -complete=file -nargs=? Vsplit call split('v', ) -command! -complete=file -nargs=? New call split('h', '__vscode_new__') -command! -complete=file -nargs=? Vnew call split('v', '__vscode_new__') -command! -bang Only if == '!' | call closeOtherEditors() | else | call VSCodeNotify('workbench.action.joinAllGroups') | endif - -nnoremap s :call split('h') -xnoremap s :call split('h') - -nnoremap v :call split('v') -xnoremap v :call split('v') - -nnoremap n :call splitNew('h', '__vscode_new__') -xnoremap n :call splitNew('h', '__vscode_new__') - -nnoremap :call VSCodeNotify('workbench.action.focusBelowGroup') -xnoremap :call VSCodeNotify('workbench.action.focusBelowGroup') -nnoremap :call VSCodeNotify('workbench.action.focusAboveGroup') -xnoremap :call VSCodeNotify('workbench.action.focusAboveGroup') -nnoremap :call VSCodeNotify('workbench.action.focusLeftGroup') -xnoremap :call VSCodeNotify('workbench.action.focusLeftGroup') -nnoremap :call VSCodeNotify('workbench.action.focusRightGroup') -xnoremap :call VSCodeNotify('workbench.action.focusRightGroup') - -nnoremap = :call VSCodeNotify('workbench.action.evenEditorWidths') -xnoremap = :call VSCodeNotify('workbench.action.evenEditorWidths') - -nnoremap > :call manageEditorSize(v:count, 'increase') -xnoremap > :call manageEditorSize(v:count, 'increase') -nnoremap + :call manageEditorSize(v:count, 'increase') -xnoremap + :call manageEditorSize(v:count, 'increase') -nnoremap < :call manageEditorSize(v:count, 'decrease') -xnoremap < :call manageEditorSize(v:count, 'decrease') -nnoremap - :call manageEditorSize(v:count, 'decrease') -xnoremap - :call manageEditorSize(v:count, 'decrease') - -nnoremap _ :call VSCodeNotify('workbench.action.toggleEditorWidths') - -- cgit v1.2.3