diff --git a/.gitignore b/.gitignore index 5527336695..144e07def0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ sources_forked/yankring/doc/tags sources_non_forked/tlib/doc/tags sources_non_forked/ctrlp.vim/doc/tags* my_plugins/ +my_configs/ my_configs.vim tags .DS_Store diff --git a/README.md b/README.md index 6477280b76..aa292c3dbb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + ![VIM](https://dnp4pehkvoo6n.cloudfront.net/43c5af597bd5c1a64eb1829f011c208f/as/Ultimate%20Vimrc.svg) # The Ultimate vimrc @@ -60,8 +61,7 @@ If you have vim aliased as `vi` instead of `vim`, make sure to either alias it: ## How to update to latest version? -Just do a git rebase! - +Just do a git rebase! Python 3 is required. cd ~/.vim_runtime git reset --hard @@ -107,6 +107,8 @@ I recommend reading the docs of these plugins to understand them better. Each pl * [vim-indent-guides](https://github.com/nathanaelkane/vim-indent-guides) Is a plugin for visually displaying indent levels in Vim * [editorconfig-vim](https://github.com/editorconfig/editorconfig-vim) EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs * [copilot.vim](https://github.com/github/copilot.vim) Plugin for GitHub Copilot (AI autocompletion FTW 😅) +* [vim-terraform](https://github.com/hashivim/vim-terraform) Plugin for syntax highlighting, indentation and more for HCL and Terraform-related files +* [vim-wayland-clipboard](https://github.com/jasonccox/vim-wayland-clipboard) Plugin that allows Vim to integrate with the Wayland clipboard when using the `+` register ## Included color schemes @@ -148,7 +150,10 @@ For instance, my `my_configs.vim` looks like this: ~/.vim_runtime > cat my_configs.vim map ct :cd ~/Desktop/Todoist/todoist - map cw :cd ~/Desktop/Wedoist/wedoist + map cw :cd ~/Desktop/Wedoist/wedoist + +To further structure your own stuff or to enable integration in *dotfile* managers like [chezmoi](https://chezmoi.io) +place `.vim` files with `vimrc` matching syntax in the `~/.vim_runtime/my_configs/` directory. You can also install your plugins, for instance, via pathogen you can install [vim-rails](https://github.com/tpope/vim-rails): @@ -201,6 +206,7 @@ map bd :Bclose " Close all buffers map ba :1,1000 bd! ``` + Useful mappings for managing tabs: ```vim map tn :tabnew @@ -256,7 +262,7 @@ vnoremap $e `>a`` ### Insert mode mappings -Quickly insert parenthesis/brackets/etc.: +Quickly insert parenthesis/brackets/etc., disabled by default for Shell, PHP, and Perl and enabled by default for other files, can be toggled on and of by pressing `u`: ```vim inoremap $1 ()i inoremap $2 []i @@ -289,7 +295,8 @@ cnoremap Write the file as sudo (works only on Unix). Super useful when you open a file and you don't have permissions to save your changes. [Vim tip](http://vim.wikia.com/wiki/Su-write): - :W + :W + :Wq ### Plugin related mappings @@ -367,6 +374,7 @@ nmap a (ale_next_wrap) nnoremap v :.GBrowse! xnoremap v :'<'>GBrowse! ``` +[copilot.vim](https://github.com/github/copilot.vim) is disabled by default. Setup with `:Copilot setup`. To enable it by default, add `let g:copilot_enabled = v:true` in `my_configs.vim`. To toggle it on and off, press `gc` ### Spell checking Pressing `ss` will toggle spell checking: ```vim @@ -416,3 +424,4 @@ Maintaining this Vim configuration isn't my day job. Daily I am the founder/CEO PS: Using Vim isn't a requirement 😄 + diff --git a/install_awesome_parameterized.sh b/install_awesome_parameterized.sh index 1ca2ba5f95..5dacb4eaf3 100755 --- a/install_awesome_parameterized.sh +++ b/install_awesome_parameterized.sh @@ -6,6 +6,7 @@ cd $1 VIMRC="\" DO NOT EDIT THIS FILE \" Add your own customizations in $1/my_configs.vim +\" See $1/README.md \"How to include your own stuff\" for further options. set runtimepath+=$1 @@ -14,10 +15,20 @@ source $1/vimrcs/filetypes.vim source $1/vimrcs/plugins_config.vim source $1/vimrcs/extended.vim -try - source $1/my_configs.vim -catch -endtry" +let files = glob(\"$1/my_configs/*.vim\", 1, 1) +if empty(files) + try + source $1/my_configs.vim + catch + endtry +else + for file in files + try + execute 'source' fnameescape(file) + catch + endtry + endfor +endif" if [ "$2" = "--all" ]; then USERS=$(ls -l /home | awk '{if(NR>1)print $9}') diff --git a/install_awesome_vimrc.sh b/install_awesome_vimrc.sh index 2946697722..56c7bb6962 100755 --- a/install_awesome_vimrc.sh +++ b/install_awesome_vimrc.sh @@ -5,6 +5,7 @@ cd ~/.vim_runtime echo '" DO NOT EDIT THIS FILE " Add your own customizations in ~/.vim_runtime/my_configs.vim +" See ~/.vim_runtime/README.md "How to include your own stuff" for further options. set runtimepath+=~/.vim_runtime @@ -12,9 +13,20 @@ source ~/.vim_runtime/vimrcs/basic.vim source ~/.vim_runtime/vimrcs/filetypes.vim source ~/.vim_runtime/vimrcs/plugins_config.vim source ~/.vim_runtime/vimrcs/extended.vim -try - source ~/.vim_runtime/my_configs.vim -catch -endtry' > ~/.vimrc + +let files=glob("~/.vim_runtime/my_configs/*.vim", 1, 1) +if empty(files) + try + source ~/.vim_runtime/my_configs.vim + catch + endtry +else + for file in files + try + execute 'source' fnameescape(file) + catch + endtry + endfor +endif' > ~/.vimrc echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)" diff --git a/sources_forked/vim-peepopen/plugin/peepopen.vim b/sources_forked/vim-peepopen/plugin/peepopen.vim index eadb413eac..d5492ac3a1 100644 --- a/sources_forked/vim-peepopen/plugin/peepopen.vim +++ b/sources_forked/vim-peepopen/plugin/peepopen.vim @@ -47,7 +47,7 @@ noremap