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

How to setup vim configurations only for vimcoder? #16

Open
huntzhan opened this issue Dec 21, 2015 · 1 comment
Open

How to setup vim configurations only for vimcoder? #16

huntzhan opened this issue Dec 21, 2015 · 1 comment
Labels

Comments

@huntzhan
Copy link

The solution is to consider whether or not such settings should actually be global; if they should be global, change setlocal to set in your vimrc file. Alternatively, if you want certain settings to be set only for certain kinds of buffers, you can use the autocmd command to selectively set settings according to file path pattern and various events. See :help autocmd for more information.

First of all, thanks for your amazing vim plugin!

I've installed jiangmiao/auto-pairs for auto-completing braces, but for some reason, maybe the reason you discussed on README, the plugin doesn't work in vimcoder. I want to make a quick fix by writing something as follow:

if run in vimcoder:
  inoremap { {<CR>}<Esc>ko
endif

So, here's the problem. It's there a way to test vimcoder is running?

@chazmcgarvey
Copy link
Owner

You can indeed use autocmd to do that:

autocmd BufNewFile,BufRead /path/to/your/vimcoder/* inoremap { {<CR>}<Esc>ko

This runs your Vim command (the inoremap) whenever a new file is created in or an existing file is read from the /path/to/your/vimcoder directory.

Sorry for the late response, but hopefully that helps.

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

No branches or pull requests

2 participants