question on ~/.vim/after
bsr203 opened this issue · 7 comments
Hi,
Thanks for posting your files. It it quite useful as I am developing a react based app and you have lot of goodies for that. I am not an expert and I don't use pathogen but vundle. Can you please tell me how scripts in ~/.vim/after
are executed. basically, snippets for jasmine test files are not loaded probably because the file type is added in the scripts at ~/.vim/after folder. so, I wanted to see how I can make them run so that proper file type and snippets are initialized.
thanks
bsr
I believe that the ~/.vim/after
directory is loaded after the plugin directory. You can get some more information on this by running :help after-directory
in Vim.
With UltiSnips, the snippet filenames should correspond to the filetype that Vim thinks the file is. When you are in a file, you can find out what filetype Vim thinks it is by running :set ft?
. Filetypes can be multi-part, delimited by periods. For example, javascript.jsx
will use both jsx
and javascript
filetypes.
Filetype detection in vim is handled by files in the ftdetect
directory (which can also be nested in the after
directory if you need it to happen after your plugins). Some plugins provide their own filetype detection, so a lot of things should work out of the box, but occasionally you need to add your own, and occasionally you want your own to take precedence over what your plugins will do.
For example, I want my JSX files to be javascript.jsx
(which is now covered by vim-jsx as of mxw/vim-jsx@c8fc9ec) and I want my JSX files that end in _spec.jsx
to be javascript.jasmine.jsx
(which is not covered by vim-jsx), so I put my jsx.vim
ftdetect
in the after
directory. This allows me to have jsx.snippets
, jasmine.snippets
, and javascript.snippets
.
I hope this helps!
thanks a ton. my tests were ended with -test, so adding along with Spec,-spec made it work. Thanks for explaining in detail.
one more quick qn. When expand PropType (Pt)
snippet, I ended up with
PropTypes.(array|bool|func|number|object|string|node|element|instanceOf|oneOf|oneOfType|arrayOf|objectOf|shape|any),
how do I choose one of these option when my cursor is at PropTypes.
That particular snippet is using a completion function that will sort of auto filter as you type. So to select one, you should just start typing. It doesn't work super great though, so I'm not sure I'd recommend using it as is.
Thanks again for your help :-)
Hi, I started using more of your feature and ended up using all your dotfiles. I cloned it in to my home folder and ran the init
script. Though I use vim for my entire life, I never used tmux, zsh. Can you please tell me how you start using your environment to develop a javascript app.
I tried like
- open a new terminal (load bash by default)
- zsh
- tmux
- vim
the colors on vim looks bad. How do you enable full color when running from terminal (I couldn't find g:solarized_termcolors
or anything similar in your dotfiles)
thanks a ton.
EDIT:
I probably figured out the first part. you might be using tmuxinator
to start the tmux session.
so, is it like
- start
iterm2
- tmuxinator start brigade
I still don't have colors though. colorscheme
in my vim shows base16-default
. still digging :-)
changing terminal to zsh
solved the issue related to color. I see you changed your preferred color recently to base16
:-)
Great, it sounds like you got things figured out. If you are in the giving mood, I would love to review a PR that adds some instructions in a readme.