vim

Vim startup errors (invalid expression) Debian

我只是一个虾纸丫 提交于 2020-01-01 07:57:10
问题 I'm having issues setting up Vim. Firstly I'm having a bunch of errors when start up Vim, I get these errors: Error detected while processing /home/lee/.vimrc: line 5: E492: Not an editor command: generate helptags for everything in 'runtimepath' Error detected while processing /home/lee/.vim/plugin/fuf.vim: line 13: ***** L9 library must be installed! ***** Error detected while processing /home/lee/.vim/plugin/refactor.vim: line 45: E492: Not an editor command: ^M line 53: E492: Not an

How can I set the Python max allowed line length to 120 in Syntastic for Vim?

房东的猫 提交于 2020-01-01 07:36:26
问题 I'm using python-mode for Vim, I prefer for there to be 120 character lines rather than the stark 80 as defined in the PEP8 standard. In python-mode, this is easy. I just add the following to my ~/.vimrc: " Pylint configuration file let g:pymode_lint_config = '$HOME/.pylint.rc' let g:pymode_options_max_line_length=120 This works great, but then, I also wanted to use the superb Syntastic plugin for checking syntax of various other kinds (Chef recipes for foodcritic, for example.) Unfortunately

Jumping back to a previously opened file in Vim

与世无争的帅哥 提交于 2020-01-01 07:34:09
问题 While using Vim I'll sometimes want to look at a function definition or a struct definition, so I'll use C-] to jump to it. However, there are a few problems I run into. First off, I don't know how to jump back easily. It appears the previous file I was in closes and I'm now in the new one. Is there a way to jump back, or keep a stack of open files that I can pop back to or something? Another thing I've noticed that when I have a change in the current file I need to save it because, like a

Quickest way to select an entire Sass ruleset in Vim?

天大地大妈咪最大 提交于 2020-01-01 06:29:05
问题 Just starting with Vim and I wondered – given a Sass block like this: .thing { width: 100%; color: $color1; .nested { height: 1rem; } } If my cursor is at the 'd' within 'width', what's the quickest way to visually select the entire rule set, selector, braces and all? At present I am using 'Shift+}' to jump to the next blank line and then 'v' for visual and 'Shift+{' to select the prior block. Any better way? 回答1: You're close. As you're already using the { and } motions to the borders of the

Setting a keyboard shortcut for a vim command

亡梦爱人 提交于 2020-01-01 05:25:08
问题 Say I want <C-*> to provide me the functionality of the :set nohlsearch command. How do I accomplish this? The map command only seems to be able to map a set of keystrokes with another set. How can a key combination be mapped to a command? 回答1: You'd do it like this: :nnoremap <C-*> :set nohlsearch<CR> <C-*> means pressing Ctrl and Shift and 8 (on an English keyboard layout, at least) simultaneously. Unfortunately, that particular combination won't work. Due to the way that the keyboard input

Vim: Combining autocmd?

孤街浪徒 提交于 2020-01-01 05:21:07
问题 I need to do the logical-and of two autocmd events in vim. Basically, the command has to run on an InsertLeave when the FileType is tex. It seems like this should work (in a .vimrc): autocmd FileType tex :autocmd InsertLeave :w But it doesn't. The nested option doesn't seem to help either, even though the manual indicates it should. Its easy to do a logical-OR: autocmd BufEnter,BufLeave ... it mustn't be too hard to do a logical-AND. 回答1: I have a correction to @Eevee answer: to make

How to copy text from commandline mode in Vim

那年仲夏 提交于 2020-01-01 05:20:10
问题 I type this command in Vim: :nmap <CR> <C-]> Then I want to copy this line and put it into my .vimrc How can i select and copy the whole line in commandline mode ? Thanks 回答1: The fastest way is to run the command, switch to the destination buffer (with .vimrc loaded, in this case) and paste the whole command from the : register by typing ":p in Normal mode. If the command is far back in time, one can first recall it from history (typing the first few letters and pressing Up , for example),

vim on mac os X function key mapping not working

非 Y 不嫁゛ 提交于 2020-01-01 05:14:11
问题 I have recently started using a Mac OS X Lion system and tried to use Vim in terminal. I previously had a .vimrc file in my Ubuntu system and had F2 and F5 keys mapped to pastetoggle and run python interpreter. Here are the two lines I have for it: set pastetoggle=<F2> map <buffer> <F5> :wa<CR>:!/usr/bin/env python % <CR> It's working just fine in Ubuntu but no longer works in Mac. (The above two lines are in .vimrc under my home dir.) I have turned off the Mac specific functions in my

Vim: snipMate plug-in does not trigger snippet completion

别来无恙 提交于 2020-01-01 05:12:52
问题 Vim is installed at /usr/share/vim. All snipMate's folders were added to this category in existing folders (after, autoload, plugin, snippets, etc.) accordingly. From the documentation file: For instance, to change the trigger key to CTRL-J, just change this: ino <tab> <c-r>=TriggerSnippet()<cr> snor <tab> <esc>i<right><c-r>=TriggerSnippet()<cr> to this: ino <c-j> <c-r>=TriggerSnippet()<cr> snor <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr> I tried this as well - the same result. When I try

Is haskellmode-vim dead?

我的未来我决定 提交于 2020-01-01 04:41:05
问题 I just disabled haskellmode-vim from my plugin configurations. Basically this was for three reasons: I prefer neocomplcache for my auto completion needs. Apparently it wasn't updated since 2010. It doesn't seem to be compatible with cabal I hope that someone jumps in the pit and points out that I just have misconfigured the whole thing (as in I configured the most basic thing in the readme). To make this a question: Is it possible to setup haskellmode such that ... ... it gets its