diff --git a/homebrew/programming.Brewfile b/homebrew/programming.Brewfile index 1523751..be9395e 100644 --- a/homebrew/programming.Brewfile +++ b/homebrew/programming.Brewfile @@ -1,6 +1,7 @@ # Programming Packages brew "shellcheck" # Lint for bash +brew "shfmt" # Formatter for bash brew "python" # Latest version of Python brew "ipython" # Better interactive Python shell brew "poetry" # Project-based Python dependencies diff --git a/nvim.configlink/coc-settings.json b/nvim.configlink/coc-settings.json index bb3cf94..3f2d9bd 100644 --- a/nvim.configlink/coc-settings.json +++ b/nvim.configlink/coc-settings.json @@ -1,4 +1,11 @@ { "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" + } } diff --git a/nvim.configlink/init.vim b/nvim.configlink/init.vim index 05e48ce..215ac9c 100644 --- a/nvim.configlink/init.vim +++ b/nvim.configlink/init.vim @@ -13,23 +13,28 @@ endif " All plugins call plug#begin('~/.config/nvim/plugged') +" Core plugins Plug 'morhetz/gruvbox' " Colorscheme Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Required for fuzzyfinder Plug 'junegunn/fzf.vim' " Actual fuzzyfinder 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 '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 'jreybert/vimagit' " Git 'gui' buffer -Plug 'airblade/vim-gitgutter' " Git next to line numbers Plug 'tpope/vim-fugitive' " Other git commands Plug 'machakann/vim-highlightedyank' " Highlight text when copied -Plug 'godlygeek/tabular' " Spacing and alignment Plug 'itchyny/lightline.vim' " Status bar Plug 'tpope/vim-vinegar' " Fixes netrw file explorer Plug 'lambdalisue/fern.vim' " File explorer / project drawer Plug 'christoomey/vim-tmux-navigator' " Hotkeys for tmux panes + +" CoC Plug 'neoclide/coc.nvim', {'branch': 'release'} " Code completion call plug#end() @@ -135,6 +140,9 @@ nnoremap ` :GitGutterToggle " Git push nnoremap gp :Git push +" Split window +nnoremap ws :vsplit + " Close all other splits nnoremap wm :only @@ -144,13 +152,17 @@ noremap ft :Fern . -drawer -width=35 -toggle= " 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 inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() inoremap pumvisible() ? "\" : "\" function! s:check_back_space() abort @@ -190,21 +202,14 @@ autocmd CursorHold * silent call CocActionAsync('highlight') " Symbol renaming. nmap rn (coc-rename) -" Applying codeAction to the selected region. -" Example: `aap` for current paragraph -xmap a (coc-codeaction-selected) -nmap a (coc-codeaction-selected) - -" Remap keys for applying codeAction to the current buffer. -nmap ac (coc-codeaction) -" Apply AutoFix to problem on the current line. -nmap qf (coc-fix-current) - " Use CTRL-S for selections ranges. " Requires 'textDocument/selectionRange' support of LS, ex: coc-tsserver nmap (coc-range-select) xmap (coc-range-select) +" LaTeX Settings +"--------------- + " LaTeX Hotkeys autocmd FileType tex inoremap ;bf \textbf{}i " Jump to the next occurence of <> and replace it with insert mode @@ -217,18 +222,18 @@ autocmd BufWritePost *.tex silent! execute "!pdflatex -output-directory=%:p:h % "---------------- " Built-in explorer plugin -let g:netrw_liststyle = 3 " Change style to 'tree' view -let g:netrw_banner = 0 " Remove useless banner -let g:netrw_winsize = 15 " Explore window takes % of page -let g:netrw_browse_split = 4 " Open in previous window -let g:netrw_altv = 1 " Always split left +let g:netrw_liststyle = 3 " Change style to 'tree' view +let g:netrw_banner = 0 " Remove useless banner +let g:netrw_winsize = 15 " Explore window takes % of page +let g:netrw_browse_split = 4 " Open in previous window +let g:netrw_altv = 1 " Always split left " Gitgutter plugin -let g:gitgutter_enabled = 1 " Enabled on start +let g:gitgutter_enabled = 1 " Enabled on start " Polyglot syntax plugin -let g:terraform_fmt_on_save=1 " Formats with terraform plugin -let g:rustfmt_autosave = 1 " Formats with rust plugin +let g:terraform_fmt_on_save=1 " Formats with terraform plugin +let g:rustfmt_autosave = 1 " Formats with rust plugin " VimWiki plugin let g:vimwiki_list = [ diff --git a/shell/templates/help b/shell/templates/help new file mode 100644 index 0000000..1e5bc66 --- /dev/null +++ b/shell/templates/help @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + cat <