vim cleanup and shellcheck

This commit is contained in:
Noah Masur 2021-04-10 11:56:38 -04:00
parent 6678ef35a9
commit 5275fcb93e
4 changed files with 48 additions and 27 deletions

View File

@ -1,6 +1,7 @@
# Programming Packages # Programming Packages
brew "shellcheck" # Lint for bash brew "shellcheck" # Lint for bash
brew "shfmt" # Formatter for bash
brew "python" # Latest version of Python brew "python" # Latest version of Python
brew "ipython" # Better interactive Python shell brew "ipython" # Better interactive Python shell
brew "poetry" # Project-based Python dependencies brew "poetry" # Project-based Python dependencies

View File

@ -1,4 +1,11 @@
{ {
"rust-analyzer.serverPath": "/usr/local/bin/rust-analyzer", "rust-analyzer.serverPath": "/usr/local/bin/rust-analyzer",
"rust-analyzer.checkOnSave.enable": true "rust-analyzer.checkOnSave.enable": true,
"diagnostic-languageserver.filetypes": {
"sh": "shellcheck"
},
"diagnostic-languageserver.formatFiletypes": {
"python": "black",
"sh": "shfmt"
}
} }

View File

@ -13,23 +13,28 @@ endif
" All plugins " All plugins
call plug#begin('~/.config/nvim/plugged') call plug#begin('~/.config/nvim/plugged')
" Core plugins
Plug 'morhetz/gruvbox' " Colorscheme Plug 'morhetz/gruvbox' " Colorscheme
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Required for fuzzyfinder Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Required for fuzzyfinder
Plug 'junegunn/fzf.vim' " Actual fuzzyfinder Plug 'junegunn/fzf.vim' " Actual fuzzyfinder
Plug 'tpope/vim-surround' " Enables paren editing Plug 'tpope/vim-surround' " Enables paren editing
Plug 'tpope/vim-commentary' " Use gc or gcc to comment
Plug 'unblevable/quick-scope' " Hints for f and t
Plug 'sheerun/vim-polyglot' " Syntax for every language Plug 'sheerun/vim-polyglot' " Syntax for every language
Plug 'airblade/vim-gitgutter' " Git next to line numbers
Plug 'tpope/vim-commentary' " Use gc or gcc to comment
Plug 'godlygeek/tabular' " Spacing and alignment
" Ancillary plugins
Plug 'unblevable/quick-scope' " Hints for f and t
Plug 'vimwiki/vimwiki' " Wiki Markdown System Plug 'vimwiki/vimwiki' " Wiki Markdown System
Plug 'jreybert/vimagit' " Git 'gui' buffer Plug 'jreybert/vimagit' " Git 'gui' buffer
Plug 'airblade/vim-gitgutter' " Git next to line numbers
Plug 'tpope/vim-fugitive' " Other git commands Plug 'tpope/vim-fugitive' " Other git commands
Plug 'machakann/vim-highlightedyank' " Highlight text when copied Plug 'machakann/vim-highlightedyank' " Highlight text when copied
Plug 'godlygeek/tabular' " Spacing and alignment
Plug 'itchyny/lightline.vim' " Status bar Plug 'itchyny/lightline.vim' " Status bar
Plug 'tpope/vim-vinegar' " Fixes netrw file explorer Plug 'tpope/vim-vinegar' " Fixes netrw file explorer
Plug 'lambdalisue/fern.vim' " File explorer / project drawer Plug 'lambdalisue/fern.vim' " File explorer / project drawer
Plug 'christoomey/vim-tmux-navigator' " Hotkeys for tmux panes Plug 'christoomey/vim-tmux-navigator' " Hotkeys for tmux panes
" CoC
Plug 'neoclide/coc.nvim', {'branch': 'release'} " Code completion Plug 'neoclide/coc.nvim', {'branch': 'release'} " Code completion
call plug#end() call plug#end()
@ -135,6 +140,9 @@ nnoremap <Leader>` :GitGutterToggle<cr>
" Git push " Git push
nnoremap <Leader>gp :Git push<cr> nnoremap <Leader>gp :Git push<cr>
" Split window
nnoremap <Leader>ws :vsplit<cr>
" Close all other splits " Close all other splits
nnoremap <Leader>wm :only<cr> nnoremap <Leader>wm :only<cr>
@ -144,7 +152,11 @@ noremap <silent> <Leader>ft :Fern . -drawer -width=35 -toggle<CR><C-w>=
" CoC Settings " CoC Settings
"------------- "-------------
let g:coc_global_extensions = ['coc-rust-analyzer', 'coc-pairs'] let g:coc_global_extensions = [
\ 'coc-rust-analyzer',
\ 'coc-pairs',
\ 'coc-diagnostic',
\ ]
" Set tab to completion " Set tab to completion
inoremap <silent><expr> <TAB> inoremap <silent><expr> <TAB>
@ -190,21 +202,14 @@ autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming. " Symbol renaming.
nmap <leader>rn <Plug>(coc-rename) nmap <leader>rn <Plug>(coc-rename)
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Use CTRL-S for selections ranges. " Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of LS, ex: coc-tsserver " Requires 'textDocument/selectionRange' support of LS, ex: coc-tsserver
nmap <silent> <C-s> <Plug>(coc-range-select) nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select) xmap <silent> <C-s> <Plug>(coc-range-select)
" LaTeX Settings
"---------------
" LaTeX Hotkeys " LaTeX Hotkeys
autocmd FileType tex inoremap ;bf \textbf{}<Esc>i autocmd FileType tex inoremap ;bf \textbf{}<Esc>i
" Jump to the next occurence of <> and replace it with insert mode " Jump to the next occurence of <> and replace it with insert mode

8
shell/templates/help Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
cat <<EOH
Help text
EOH
exit
fi