Skip to content

Add sourcing from my_configs/ #757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ For instance, my `my_configs.vim` looks like this:

~/.vim_runtime > cat my_configs.vim
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 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):

Expand Down Expand Up @@ -201,6 +204,7 @@ map <leader>bd :Bclose<cr>
" Close all buffers
map <leader>ba :1,1000 bd!<cr>
```

Useful mappings for managing tabs:
```vim
map <leader>tn :tabnew<cr>
Expand Down
19 changes: 15 additions & 4 deletions install_awesome_parameterized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}')
Expand Down
20 changes: 16 additions & 4 deletions install_awesome_vimrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,28 @@ 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

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 :-)"