Add sourcing from my_configs/
To enable structurizing of own stuff or using *dotfile* managers, this PR add the sourcing of `*.vim` files from the `my_config/` directory. If the `glob("~/.vim_runtime/my_configs/*.vim",1,1)` list is empty, the `~/.vim_runtime/my_configs.vim` is sourced as previously.
This commit is contained in:
parent
ee7e062909
commit
5444b76f9d
4 changed files with 38 additions and 10 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,6 +5,7 @@ sources_forked/yankring/doc/tags
|
||||||
sources_non_forked/tlib/doc/tags
|
sources_non_forked/tlib/doc/tags
|
||||||
sources_non_forked/ctrlp.vim/doc/tags*
|
sources_non_forked/ctrlp.vim/doc/tags*
|
||||||
my_plugins/
|
my_plugins/
|
||||||
|
my_configs/
|
||||||
my_configs.vim
|
my_configs.vim
|
||||||
tags
|
tags
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
|
@ -148,7 +148,10 @@ For instance, my `my_configs.vim` looks like this:
|
||||||
|
|
||||||
~/.vim_runtime > cat my_configs.vim
|
~/.vim_runtime > cat my_configs.vim
|
||||||
map <leader>ct :cd ~/Desktop/Todoist/todoist<cr>
|
map <leader>ct :cd ~/Desktop/Todoist/todoist<cr>
|
||||||
map <leader>cw :cd ~/Desktop/Wedoist/wedoist<cr>
|
map <leader>cw :cd ~/Desktop/Wedoist/wedoist<cr>
|
||||||
|
|
||||||
|
To further structurize 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):
|
You can also install your plugins, for instance, via pathogen you can install [vim-rails](https://github.com/tpope/vim-rails):
|
||||||
|
|
||||||
|
@ -201,6 +204,7 @@ map <leader>bd :Bclose<cr>
|
||||||
" Close all buffers
|
" Close all buffers
|
||||||
map <leader>ba :1,1000 bd!<cr>
|
map <leader>ba :1,1000 bd!<cr>
|
||||||
```
|
```
|
||||||
|
|
||||||
Useful mappings for managing tabs:
|
Useful mappings for managing tabs:
|
||||||
```vim
|
```vim
|
||||||
map <leader>tn :tabnew<cr>
|
map <leader>tn :tabnew<cr>
|
||||||
|
|
|
@ -6,6 +6,7 @@ cd $1
|
||||||
|
|
||||||
VIMRC="\" DO NOT EDIT THIS FILE
|
VIMRC="\" DO NOT EDIT THIS FILE
|
||||||
\" Add your own customizations in $1/my_configs.vim
|
\" Add your own customizations in $1/my_configs.vim
|
||||||
|
\" See ~/.vim_runtime/README.md \"How to include your own stuff\" for further options.
|
||||||
|
|
||||||
set runtimepath+=$1
|
set runtimepath+=$1
|
||||||
|
|
||||||
|
@ -14,10 +15,20 @@ source $1/vimrcs/filetypes.vim
|
||||||
source $1/vimrcs/plugins_config.vim
|
source $1/vimrcs/plugins_config.vim
|
||||||
source $1/vimrcs/extended.vim
|
source $1/vimrcs/extended.vim
|
||||||
|
|
||||||
try
|
let files = glob(\"$1/my_configs/*.vim\", 1, 1)
|
||||||
source $1/my_configs.vim
|
if empty(files)
|
||||||
catch
|
try
|
||||||
endtry"
|
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
|
if [ "$2" = "--all" ]; then
|
||||||
USERS=$(ls -l /home | awk '{if(NR>1)print $9}')
|
USERS=$(ls -l /home | awk '{if(NR>1)print $9}')
|
||||||
|
|
|
@ -4,7 +4,8 @@ set -e
|
||||||
cd ~/.vim_runtime
|
cd ~/.vim_runtime
|
||||||
|
|
||||||
echo '" DO NOT EDIT THIS FILE
|
echo '" DO NOT EDIT THIS FILE
|
||||||
" Add your own customizations in ~/.vim_runtime/my_configs.vim
|
" Add your own customizations in $1/my_configs.vim
|
||||||
|
" See ~/.vim_runtime/README.md "How to include your own stuff" for further options.
|
||||||
|
|
||||||
set runtimepath+=~/.vim_runtime
|
set runtimepath+=~/.vim_runtime
|
||||||
|
|
||||||
|
@ -12,9 +13,20 @@ source ~/.vim_runtime/vimrcs/basic.vim
|
||||||
source ~/.vim_runtime/vimrcs/filetypes.vim
|
source ~/.vim_runtime/vimrcs/filetypes.vim
|
||||||
source ~/.vim_runtime/vimrcs/plugins_config.vim
|
source ~/.vim_runtime/vimrcs/plugins_config.vim
|
||||||
source ~/.vim_runtime/vimrcs/extended.vim
|
source ~/.vim_runtime/vimrcs/extended.vim
|
||||||
try
|
|
||||||
source ~/.vim_runtime/my_configs.vim
|
let files=glob("~/.vim_runtime/my_configs/*.vim", 1, 1)
|
||||||
catch
|
if empty(files)
|
||||||
endtry' > ~/.vimrc
|
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 :-)"
|
echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)"
|
||||||
|
|
Loading…
Reference in a new issue