Skip to content

Commit

Permalink
fix(Neovim): Change custom conf location
Browse files Browse the repository at this point in the history
Now the .vimrc.preconf and .vimrc.postconf are in the vimmic folder.
This allows a unified way to deal with vim / nvim along to an easy
Windows compliance. Moreover, it is in accordance with the .config
philosophy by avoiding pollution on the HOME folder.
  • Loading branch information
CharlesGueunet committed Aug 29, 2017
1 parent 4453ded commit a8406e2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 30 deletions.
16 changes: 8 additions & 8 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ let g:file_sep = (g:isWin)?'\':'/'
" Exemples on Linux, using original vim
" ~/
let g:Vimmic_HOME = fnamemodify(expand('<sfile>'), ':p:h:gs').g:file_sep
" ~/.vim/
" ~/.vimmic/
let g:Vimmic_BASE = fnamemodify(resolve(expand('<sfile>')), ':p:h:gs').g:file_sep
" ~/.vim/config/
" ~/.vimmic/config/
let g:Vimmic_CONFIG = g:Vimmic_BASE."config".g:file_sep
" ~/.vim/config/plugins/
" ~/.vimmic/config/plugins/
let g:Vimmic_CONFIG_PLUGINS = g:Vimmic_CONFIG."plugins".g:file_sep
" ~/.vimrc.preconf
let g:Vimmic_PRECONF = $HOME."/.vimrc.preconf"
" ~/.vimrc.postconf
let g:Vimmic_POSTCONF = $HOME."/.vimrc.postconf"
" ~/.vim/dein/repos/github.com/Shougo/dein.vim/
" ~/.vimmic/dein/repos/github.com/Shougo/dein.vim/
let g:Vimmic_DEIN = g:Vimmic_BASE.join(['dein','repos','github.com','Shougo','dein.vim'], g:file_sep)
" ~/.vimmic/.vimrc.preconf
let g:Vimmic_PRECONF = g:Vimmic_BASE.".vimrc.preconf"
" ~/.vimmic/.vimrc.postconf
let g:Vimmic_POSTCONF = g:Vimmic_BASE.".vimrc.postconf"
" Plugins blacklist
let g:Vimmic_DISABLED = []
" Added plugins
Expand Down
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ who is familiar with Vim.
__CHANGELOG__
--------------

* Adding and removing plugins use a new syntax described in the help.
* C/CPP projects now use a unified ".vimmic_config" file instead of ".syntastic_c_config" and a ".clang" (Last change impacting the user)
* C/CPP projects now use a unified ".vimmic_config" file instead of ".syntastic_c_config" and a ".clang"
* Change location of the custon pre/postconf files for Neovim compliance (now in the VIMMIC folder)

__Install__
-----------
Expand All @@ -34,15 +34,15 @@ Dependencies listed here are recommended but not required for all plugins:
Quick installation script:

```bash
DIRNAME=".vimmic"
VIMMIC_DIR=".vimmic"
cd ~
git clone --recursive https://github.com/CharlesGueunet/vimmic.git "${DIRNAME}"
ln -sf "${DIRNAME}"/.vimrc .
git clone --recursive https://github.com/CharlesGueunet/vimmic.git "${VIMMIC_DIR}"
ln -sf "${VIMMIC_DIR}"/.vimrc .
```

Notice you can use whatever you want in `$DIRNAME`, as long as you do not
Notice you can use whatever you want in `$VIMMIC_DIR`, as long as you do not
modify the directory path afterward (as it may break the symbolic link).
You can even put your Vim configuration inside the ".config" folder.
You can even put your Vim configuration inside the `$HOME/.config` folder.

If you want to update all plugins at once, simply run `:Update` in Vim.

Expand All @@ -57,7 +57,8 @@ ln -s ~/.vim $XDG_CONFIG_HOME/nvim
ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim
```

Note: you may need to run `:Update` afterward.
Note: you may need to run `:Update` afterward if you have already installed the plugins
with Vim.

__How to use__
--------------
Expand All @@ -78,7 +79,7 @@ and provide many tips and tricks!
### Enabling / disabling plugins

As described in the *vimmic-config* help, if you want to disable / enable
plugins, you can use the `$HOME/.vimrc.preconf` file to force our plugin
plugins, you can use the `${VIMMIC_DIR}/.vimrc.preconf` file to force our plugin
manager (Dein) to add / remove a plugin. More details are available in the
sample in `extra/vimrc.preconf.sample`.

Expand All @@ -91,7 +92,7 @@ __Structure__
All plugins are configured in their own files in `config/plugins/`.
Other files do not affect them (the *.vimrc* load them)

.vimmic/ # Vimmic install directory
${VIMMIC_DIR}/ # Vimmic install directory
.vimrc # Loads Vimmic environment, configuration and plugins
config/
editor.vim # Original vim config (files, buffers, search...)
Expand All @@ -105,9 +106,9 @@ Other files do not affect them (the *.vimrc* load them)
We also use two other files defined in the user home directory (you can see
examples of those files in the `extra/` directory):

* `$HOME/.vimrc.preconf`: tweak vimmic by adding or disabling plugins, changing
* `${VIMMIC_DIR}/.vimrc.preconf`: tweak vimmic by adding or disabling plugins, changing
the leader key, disabling part of the configuration...
* `$HOME/.vimrc.postconf`: override plugins configuration, change themes, add
* `${VIMMIC_DIR}/.vimrc.postconf`: override plugins configuration, change themes, add
your own features...

__Gallery__
Expand Down
23 changes: 13 additions & 10 deletions doc/vimmic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ This is a good usage to regularly update your plugins inside the editor.
2. Vimmic configuration *vimmic-config*

This configuration is structured as follows:
`Vimmic/` Vimmic install directory: Git directory

`$VIMMIC_DIR/` Vimmic install directory: Git directory
`-.vimrc` Load Vimmic environment, configuration and plugins

`-config/`
Expand All @@ -98,16 +99,18 @@ This configuration is structured as follows:
`+functions.vim` Some cool functions to Update, Debug,...
`+plugins/` All plugins configurations (see |vimmic-plugins|)

`-extra/` Example files for personalization of Vimmic
`-extra/` Example files for customizations

You can customize Vimmic using two files (see the "extra/" folder):
-`$HOME/.vimrc.preconf` : to add/remove plugins and features
-`$HOME/.vimrc.postconf` : to configure colorscheme, plugins and personal stuff

`$VIMMIC_DIR/`
`-.vimrc.preconf` to add/remove plugins and features
`-.vimrc.postconf` to configure colorscheme, plugins and personal stuff

2.1 Pre-configuration:~
----------------------

The optional "$HOME/.vimrc.preconf" file helps you to add or remove plugins.
The optional "$VIMMIC_DIR/.vimrc.preconf" file helps you to add or remove plugins.
A sample version of this file is located under the "extra/" folder. Adding a
new plugin from a Github repository can be done using the `g:Vimmic_ADDED`
list:
Expand Down Expand Up @@ -137,11 +140,11 @@ Note: Use this file if you want to change you default leader key.
2.2 Post-configuration:~
-----------------------

The optional "$HOME/.vimrc.postconf" file can be used to overwrite everything
defined in Vimmic. A sample version is located under the "extra/" folder.
This is the good place to adapt Vimmic to your needs. You can copy here all
your usual ".vimrc" to add features and change colors. You can also overwrite
Vimmic defined configuration.
The optional "$VIMMIC_DIR/.vimrc.postconf" file can be used to overwrite
everything defined in Vimmic. A sample version is located under the "extra/"
folder. Whit this file, yo ucan adapt Vimmic to your needs. You can copy here
all your usual ".vimrc" to add features, change colors, remap, etc. You can also
overwrite Vimmic defined configuration.

Note: To configure the plugins you have added, it is better to do it the
Vimmic's way like explained in the next chapter |vimmic-plugins|.
Expand Down

0 comments on commit a8406e2

Please sign in to comment.