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

Easily edit spf13-vim configuration #794

Merged
merged 3 commits into from
Aug 3, 2015

Conversation

j1mr10rd4n
Copy link
Contributor

The spf13-vim config is spread across multiple .vimrc files and it can be arduous to track down the location of a particular setting if you want to customize your own instance.

Viewing / Editing .vimrc files

This pull request introduces a new function EditSpf13Config() that opens a new tab containing the following windows:

  • .vimrc
  • .vimrc.before
  • .vimrc.bundles
  • .vimrc.local
  • .vimrc.before.local
  • .vimrc.bundles.local

The following .fork files are also opened if any are detected:

  • .vimrc.fork
  • .vimrc.before.fork
  • .vimrc.bundles.fork

This makes it much simpler to get an overview of and make changes to your spf13-vim configuration.

Sourcing .vimrc

Additionally, a convenience mapping is introduced that applies the configuration to the currently running vim instance so you can make changes and apply them straight away.

Mappings

The default mappings (as suggested by Steve Losh @sjl in Learn Vimscript the Hard Way) are:

  • <Leader>ev - "_e_dit ._v_imrc" - open .vimrc files for editing
  • <Leader>sv - "_s_ource ._v_imrc" - apply .vimrc configuration

These mappings are configurable by setting the following variables in .vimrc.before.local

let g:spf13_edit_config_mapping='<leader>ev'
let g:spf13_apply_config_mapping='<leader>sv'

<leader>ev is mapped to a function that opens the following files in a new tab
.vimrc
.vimrc.before
.vimrc.bundles
.vimrc.local
.vimrc.before.local
.vimrc.bundles.local
.vimrc.fork
.vimrc.before.fork
.vimrc.bundles.fork

<leader>sv is mapped to a function that reloads the spf13 config
A user can set the following variables in their .vimrc.before.local file
to customise the key mappings:

g:spf13_edit_config_mapping
g:spf13_apply_config_mapping

the defaults are <leader>ev and <leader>sv respectively
@ghost
Copy link

ghost commented Jul 27, 2015

ping @spf13 ?

@spf13
Copy link
Owner

spf13 commented Aug 3, 2015

Wow @j1mr10rd4n This is super well done. Thanks for this contribution!

spf13 added a commit that referenced this pull request Aug 3, 2015
@spf13 spf13 merged commit eeb5c57 into spf13:3.0 Aug 3, 2015
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

Successfully merging this pull request may close these issues.

None yet

2 participants