vim

solarized coloring only *fully* working in .vimrc file, other files have syntax coloring issues

大憨熊 提交于 2020-01-04 06:25:07
问题 My .vimrc file contains : syntax on set background=light let g:solarized_termcolors=16 se t_Co=16 colorscheme solarized I have put the solarized.clr file into my ~/Library/Colors/ folder So this is some code in my .vimrc file : http://i.imgur.com/WGqMy.png This is some code in a test file within ~/ : http://i.imgur.com/fJLIh.png I've been working on this for a while now.. driving me nuts. I'm new to all of this vim configuration stuff though. 回答1: From your screenshot, it looks as you haven't

How to set auto insert new line and indent in Vim when use the auto close in pair

…衆ロ難τιáo~ 提交于 2020-01-04 05:22:21
问题 I found a Vim auto pair plugin called vim-autoclose. It works great just like other IDEs. For example, when you type { it gives you {|} (the "|" represents the cursor). Then, if you press "Enter", the {|} becomes: { | } This is what I need, but unfortunately it disables my Chinese input method application,so I have to abandon it. I have tried other autoclose plugins, but none of them can auto close in this way. I found a way to make auto close work like the way above. :autocmd FileType c,java

How to set auto insert new line and indent in Vim when use the auto close in pair

余生颓废 提交于 2020-01-04 05:22:02
问题 I found a Vim auto pair plugin called vim-autoclose. It works great just like other IDEs. For example, when you type { it gives you {|} (the "|" represents the cursor). Then, if you press "Enter", the {|} becomes: { | } This is what I need, but unfortunately it disables my Chinese input method application,so I have to abandon it. I have tried other autoclose plugins, but none of them can auto close in this way. I found a way to make auto close work like the way above. :autocmd FileType c,java

Vi is aliased to vim but exit with code 1

强颜欢笑 提交于 2020-01-04 04:15:13
问题 This is a weird return code even I have aliased vi by vim . I really appreciate if anyone could explain me why. Check my commands and results below. which vi returns /usr/bin/vi which vim returns /usr/bin/vim ls -al /usr/bin/vi /usr/bin/vim returns lrwxr-xr-x 1 root wheel 3 Dec 15 03:34 /usr/bin/vi -> vim -rwxr-xr-x 1 root wheel 1745984 Dec 10 18:03 /usr/bin/vim cat ~/.vimrc returns set nocompatible silent! unmap <C-E> vim then :q to quit immediately. Then echo $? returns 0 vi then :q to

spf13-vim disable tab highlighting

那年仲夏 提交于 2020-01-04 04:11:25
问题 I'm an absolut vim-newbie so I thought I'll try it with some preconfigured distribution like spf13-vim. So to my question, I would like to disable the "tab-highlighting" because I find it kind of distracting... I think this picture should make clear what I mean 回答1: You can toggle them on/off with ,ig . 回答2: Put a line below in your ~/.vimrc.local or ~/.vimrc.before.local to disable indent guide by default. You can <leader>ig as well. let g:indent_guides_enable_on_vim_startup = 0 回答3: write

Toggling the concealed attribute for a syntax highlight in VIM

ε祈祈猫儿з 提交于 2020-01-04 04:04:02
问题 I currently have a syntax file that parses a log file, very similar to the following [this is for syslog]: syn match syslogText /.*$/ syn match syslogFacility /.\{-1,}:/ nextgroup=syslogText skipwhite syn match syslogHost /\S\+/ nextgroup=syslogFacility,syslogText skipwhite syn match syslogDate /^.\{-}\d\d:\d\d:\d\d/ nextgroup=syslogHost skipwhite I'd like to, using a map, toggle whether a given group (let's say, syslogHost) is concealed or not. Is there any way to do something like the

Toggling the concealed attribute for a syntax highlight in VIM

拜拜、爱过 提交于 2020-01-04 04:03:54
问题 I currently have a syntax file that parses a log file, very similar to the following [this is for syslog]: syn match syslogText /.*$/ syn match syslogFacility /.\{-1,}:/ nextgroup=syslogText skipwhite syn match syslogHost /\S\+/ nextgroup=syslogFacility,syslogText skipwhite syn match syslogDate /^.\{-}\d\d:\d\d:\d\d/ nextgroup=syslogHost skipwhite I'd like to, using a map, toggle whether a given group (let's say, syslogHost) is concealed or not. Is there any way to do something like the

Vim & Java: add java import statements automatically

眉间皱痕 提交于 2020-01-04 03:56:20
问题 The tip. The errors are "E349: No identifier unders cursor", "E433: No tags file" and "E426: tag not found: public". I feel them unrelated or I cannot understand their message. I have the code in "~/.vimrc" and pressed "F1", "F9" and "ESC". A related tip but more advanced. so how can I add Java import statements automatically in Vim? [Added] I use Eclipse on the side but when it is down-or-slow-or-compiling-or-doning-something-stupid I use Vim. So stop here. What are the errs for? 回答1: Cursor

Using folds with synmaxcol in vim

一个人想着一个人 提交于 2020-01-04 02:41:08
问题 Sometimes when I'm working on a project I want to play around with some data. Often times the data is on one line and is huge (>25k characters). I understand I could set nowrap and have this line just run off the screen, but I tend to like set wrap for other reasons. So, as a workaround I want to hide these long lines in a marker fold (e.g. {{{ long line }}} ). This works fine but I run into a problem with synmaxcol for some reason. If the folded line exceeds synmaxcol then when I open the

How do I deal with vim buffers when switching git branches?

让人想犯罪 __ 提交于 2020-01-04 02:34:11
问题 So, I've got a ton of files open in my vim buffer, and I'm working on a feature branch with git. Suddenly, I realize that I need to revert back to my master branch to make a quick fix. After making my commits, I leave my vim session open and switch back over to the master branch. However, when I try and load the files I need from the buffer, I now get the message Warning: File "<filename>" has changed since editing started This makes complete since to me. The file in the buffer is from my