diff --git a/bash/.bashrc b/bash/.bashrc index d0f61dd..883e071 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -2,7 +2,6 @@ # If not running interactively, don't do anything [ -z "$PS1" ] && return - if [[ -f "${XDG_CONFIG_HOME}/bash/prompt.sh" ]]; then # shellcheck disable=SC1090 source "${XDG_CONFIG_HOME}/bash/prompt.sh" diff --git a/go/.config/vim/ftplugin/go.vim b/go/.config/vim/ftplugin/go.vim index 0f42406..c66d981 100644 --- a/go/.config/vim/ftplugin/go.vim +++ b/go/.config/vim/ftplugin/go.vim @@ -1,7 +1,4 @@ set noexpandtab -set shiftwidth=4 -set softtabstop=4 -set tabstop=4 " use goimports for formatting let g:go_fmt_command = "goimports" @@ -20,7 +17,6 @@ let g:ale_linters['go'] = ['golint', 'gopls'] "let g:go_metalinter_autosave=1 "let g:go_metalinter_autosave_enabled=['golint', 'govet', 'typecheck'] - " Open go doc in vertical window, horizontal, or tab nnoremap d :GoDef nnoremap t :GoDefType diff --git a/go/.config/vim/plug.d/go.vim b/go/.config/vim/plug.d/go.vim new file mode 100644 index 0000000..8cbb73c --- /dev/null +++ b/go/.config/vim/plug.d/go.vim @@ -0,0 +1 @@ +Plug 'fatih/vim-go', { 'tag': 'v1.24', 'for': [ 'go' ] } diff --git a/vim/.config/vim/ftplugin/rust.vim b/rust/.config/vim/ftplugin/rust.vim similarity index 100% rename from vim/.config/vim/ftplugin/rust.vim rename to rust/.config/vim/ftplugin/rust.vim diff --git a/rust/.config/vim/plug.d/rust.vim b/rust/.config/vim/plug.d/rust.vim new file mode 100644 index 0000000..bd1e9d7 --- /dev/null +++ b/rust/.config/vim/plug.d/rust.vim @@ -0,0 +1 @@ +Plug 'rust-lang/rust.vim', { 'for': 'rust' } diff --git a/vim/.config/vim/ftplugin/coffee.vim b/vim/.config/vim/ftplugin/coffee.vim deleted file mode 100644 index 86c2bba..0000000 --- a/vim/.config/vim/ftplugin/coffee.vim +++ /dev/null @@ -1,4 +0,0 @@ -set expandtab " expandtab converts tabs to spaces -set shiftwidth=2 " unify -set softtabstop=2 " Pressing backspace works like tabs -set tabstop=2 " real tabs should be 4, but they will show with set list on diff --git a/vim/.config/vim/ftplugin/gitcommit.vim b/vim/.config/vim/ftplugin/gitcommit.vim index 705568f..a46378f 100644 --- a/vim/.config/vim/ftplugin/gitcommit.vim +++ b/vim/.config/vim/ftplugin/gitcommit.vim @@ -1 +1 @@ -set nofoldenable " disable folding +setlocal nofoldenable diff --git a/vim/.config/vim/ftplugin/haml.vim b/vim/.config/vim/ftplugin/haml.vim deleted file mode 100644 index 7456ecf..0000000 --- a/vim/.config/vim/ftplugin/haml.vim +++ /dev/null @@ -1,6 +0,0 @@ - -set expandtab " expandtab converts tabs to spaces. For tabs, set noexpandtab -set shiftwidth=2 " unify -set softtabstop=2 " Pressing backspace works like tabs -set tabstop=2 " real tabs should be 4, but they will show with set list on - diff --git a/vim/.config/vim/ftplugin/html.vim b/vim/.config/vim/ftplugin/html.vim index 7456ecf..ac3f1b0 100644 --- a/vim/.config/vim/ftplugin/html.vim +++ b/vim/.config/vim/ftplugin/html.vim @@ -1,6 +1,4 @@ - -set expandtab " expandtab converts tabs to spaces. For tabs, set noexpandtab -set shiftwidth=2 " unify -set softtabstop=2 " Pressing backspace works like tabs -set tabstop=2 " real tabs should be 4, but they will show with set list on - +setlocal expandtab +setlocal shiftwidth=2 +setlocal softtabstop=2 +setlocal tabstop=2 diff --git a/vim/.config/vim/ftplugin/javascript.vim b/vim/.config/vim/ftplugin/javascript.vim index cc19f4f..0b5b638 100644 --- a/vim/.config/vim/ftplugin/javascript.vim +++ b/vim/.config/vim/ftplugin/javascript.vim @@ -1,6 +1,6 @@ -set expandtab " expandtab converts tabs to spaces -set shiftwidth=2 " unify -set softtabstop=2 " Pressing backspace works like tabs -set tabstop=2 +setlocal expandtab +setlocal shiftwidth=2 +setlocal softtabstop=2 +setlocal tabstop=2 let g:ale_linters['javascript'] = ['eslint'] diff --git a/vim/.config/vim/ftplugin/mustache.vim b/vim/.config/vim/ftplugin/mustache.vim deleted file mode 100644 index cfaa147..0000000 --- a/vim/.config/vim/ftplugin/mustache.vim +++ /dev/null @@ -1,4 +0,0 @@ -set expandtab " expandtab converts tabs to spaces. For tabs, set noexpandtab -set shiftwidth=2 " unify -set softtabstop=2 " Pressing backspace works like tabs -set tabstop=2 " real tabs should be 4, but they will show with set list on diff --git a/vim/.config/vim/ftplugin/php.vim b/vim/.config/vim/ftplugin/php.vim deleted file mode 100644 index e69f3f3..0000000 --- a/vim/.config/vim/ftplugin/php.vim +++ /dev/null @@ -1 +0,0 @@ -setlocal noexpandtab " expandtab converts tabs to spaces. For tabs, set noexpandtab diff --git a/vim/.config/vim/ftplugin/python.vim b/vim/.config/vim/ftplugin/python.vim index 07a77b6..a480732 100644 --- a/vim/.config/vim/ftplugin/python.vim +++ b/vim/.config/vim/ftplugin/python.vim @@ -1,4 +1,4 @@ -set expandtab " expandtab converts tabs to spaces. For tabs, set noexpandtab -set shiftwidth=4 " unify -set softtabstop=4 " Pressing backspace works like tabs -set tabstop=4 " real tabs should be 4, but they will show with set list on +setlocal expandtab +setlocal shiftwidth=4 +setlocal softtabstop=4 +setlocal tabstop=4 diff --git a/vim/.config/vim/ftplugin/ruby.vim b/vim/.config/vim/ftplugin/ruby.vim index cfaa147..ac3f1b0 100644 --- a/vim/.config/vim/ftplugin/ruby.vim +++ b/vim/.config/vim/ftplugin/ruby.vim @@ -1,4 +1,4 @@ -set expandtab " expandtab converts tabs to spaces. For tabs, set noexpandtab -set shiftwidth=2 " unify -set softtabstop=2 " Pressing backspace works like tabs -set tabstop=2 " real tabs should be 4, but they will show with set list on +setlocal expandtab +setlocal shiftwidth=2 +setlocal softtabstop=2 +setlocal tabstop=2 diff --git a/vim/.config/vim/ftplugin/vim.vim b/vim/.config/vim/ftplugin/vim.vim new file mode 100644 index 0000000..ac3f1b0 --- /dev/null +++ b/vim/.config/vim/ftplugin/vim.vim @@ -0,0 +1,4 @@ +setlocal expandtab +setlocal shiftwidth=2 +setlocal softtabstop=2 +setlocal tabstop=2 diff --git a/vim/.config/vim/ftplugin/yaml.vim b/vim/.config/vim/ftplugin/yaml.vim index 86c2bba..ac3f1b0 100644 --- a/vim/.config/vim/ftplugin/yaml.vim +++ b/vim/.config/vim/ftplugin/yaml.vim @@ -1,4 +1,4 @@ -set expandtab " expandtab converts tabs to spaces -set shiftwidth=2 " unify -set softtabstop=2 " Pressing backspace works like tabs -set tabstop=2 " real tabs should be 4, but they will show with set list on +setlocal expandtab +setlocal shiftwidth=2 +setlocal softtabstop=2 +setlocal tabstop=2 diff --git a/vim/.config/vim/plug.d/lang.vim b/vim/.config/vim/plug.d/lang.vim index 1f00980..7c63e1b 100644 --- a/vim/.config/vim/plug.d/lang.vim +++ b/vim/.config/vim/plug.d/lang.vim @@ -1,4 +1,2 @@ Plug 'cespare/vim-toml', { 'for': 'toml' } -Plug 'fatih/vim-go', { 'tag': 'v1.24', 'for': [ 'go' ] } Plug 'hashivim/vim-hashicorp-tools' -Plug 'rust-lang/rust.vim', { 'for': 'rust' } diff --git a/vim/.config/vim/plug.d/nerdtree.vim b/vim/.config/vim/plug.d/nerdtree.vim index 58a8b92..f767c6a 100644 --- a/vim/.config/vim/plug.d/nerdtree.vim +++ b/vim/.config/vim/plug.d/nerdtree.vim @@ -3,12 +3,10 @@ Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle', 'tag': '6.9.8' } " Close all open buffers on entering a window if the only " buffer that's left is the NERDTree buffer function! s:CloseIfOnlyNerdTreeLeft() - if exists("t:NERDTreeBufName") - if bufwinnr(t:NERDTreeBufName) != -1 - if winnr("$") == 1 - q - endif - endif + if exists("t:NERDTreeBufName") && + \ bufwinnr(t:NERDTreeBufName) != -1 && + \ winnr("$") == 1 + quit endif endfunction diff --git a/vim/.config/vim/plugin/settings.vim b/vim/.config/vim/plugin/settings.vim index cadfa04..02bfd05 100644 --- a/vim/.config/vim/plugin/settings.vim +++ b/vim/.config/vim/plugin/settings.vim @@ -7,10 +7,15 @@ if has('autocmd') filetype indent on endif +" Tabs +set complete-=i set autoindent set backspace=indent,eol,start -set complete-=i set smarttab +set noexpandtab +set shiftwidth=4 +set softtabstop=4 +set tabstop=4 set nrformats-=octal @@ -71,7 +76,6 @@ endif set sessionoptions-=options set viewoptions-=options - " Allow color schemes to do bright colors without forcing bold. if &t_Co == 8 && $TERM !~# '^Eterm' set t_Co=16 @@ -107,12 +111,6 @@ set magic set omnifunc=syntaxcomplete#Complete set completeopt=menu,longest,preview -" Tabs -set expandtab -set shiftwidth=4 -set softtabstop=4 -set tabstop=4 - " Indent set smartindent set copyindent diff --git a/vim/.config/vim/vimrc b/vim/.config/vim/vimrc index 95f4d50..5ed4c80 100644 --- a/vim/.config/vim/vimrc +++ b/vim/.config/vim/vimrc @@ -6,7 +6,7 @@ set nocompatible " can be set before loading plugin settings. This allows the plugin setting " files to set mappings with leader keys for f in split(glob($XDG_CONFIG_HOME.'/vim/init.d/*.vim'), '\n') - exe 'source' f + execute 'source '.fnameescape(f) endfor " The plugged plugin manager function calls need to be called between the @@ -14,6 +14,6 @@ endfor " loading won't work. call plug#begin($XDG_DATA_HOME.'/vim/plugged') for f in split(glob($XDG_CONFIG_HOME.'/vim/plug.d/*.vim'), '\n') - exe 'source' f + execute 'source '.fnameescape(f) endfor call plug#end()