Skip to content
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

Custom vim directory structure? #1

Closed
dideler opened this issue Jun 5, 2014 · 2 comments
Closed

Custom vim directory structure? #1

dideler opened this issue Jun 5, 2014 · 2 comments

Comments

@dideler
Copy link

dideler commented Jun 5, 2014

Hi Tokoro,

I found your dotfiles when searching how to add a keybinding to adjust the width of dwm panes in vim. To be specific, I found the file .vim/custom/vimrc/plugin/keybind/dwm.vim.

But I'm curious about your directory structure. My .vimrc is messy, I have a lot of mappings in there. I would like to try using a setup inspired by yours, e.g. .vim/mappings/dwm.vim. My question is, will vim autoload these files or do you need to configure vim and tell it to load these files?

@tokoro10g
Copy link
Owner

Hi, dideler,

You can do this by adding your directory path into runtimepath and evaluating the scripts by :runtime! command.

In my .vimrc, ~/.vim/custom is set by

set runtimepath+=~/.vim/custom

Then, the runtime scripts in some directories with reserved name like syntax or filetype under the custom directory will be loaded and evaluated automatically.
e.g.) ~/.vim/custom/syntax/foo.vim, ~/.vim/custom/colors/colorscheme.vim

As for scripts which is not in such directories, they will not be executed automatically.
So, you have to call :runtime command in order to load the remaining scripts.
Using this trick, you can achieve some extension of .vimrc. See .vimrc of mine and :help runtimepath, :help :runtime for more information.

Hope this helps 😆

@dideler
Copy link
Author

dideler commented Jun 5, 2014

Thank you very much! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants