vim

Relative number in vim

为君一笑 提交于 2020-01-01 19:17:38
问题 I noticed a strange behavior in vim regarding the relative numbers: :set nu 1 2 3 _ 4 5 6 ~ :set relativenumber 2 1 3 _ 1 2 3 ~ :set nonu 2 1 0 _ 1 2 3 ~ I was asking myself why sometime I see the absolute current line number and sometime I see 0 which is pretty useless. Is this behavior normal and how to correctly number and relativenumber ? 回答1: It's the expected behavior. From :help number_relativenumber The 'relativenumber' option changes the displayed number to be relative to the cursor.

How to compile vim 64-bit on windows using MinGW-64?

♀尐吖头ヾ 提交于 2020-01-01 19:01:16
问题 I tried to compile vim 64-bit on windows. But I don't know how to use MinGW-64. There's a mingw-32-make in the 32-bit version, which I could use to build. But I didn't find any 'make' program in the 64-bit MinGW. Could you please tell me how to use mingw-64, or any tutorial I could follow? Thank you. 回答1: It does not matter from which source make program comes, it only just must be able to execute the Makefile. To compile vim with MinGW with specific compiler and Make_ming.mak makefile I used

emacs evil equivalent of vim remapping, e.g. :nnoremap dd g0dg$

不打扰是莪最后的温柔 提交于 2020-01-01 18:57:31
问题 I am a vi/vim person at heart but I use LaTeX a lot and I really like AUCTeX Preview so I have been using emacs with viper until recently, but I am now trying evil instead. I am however certainly no emacs expert. Visual line mode in emacs is terrific with AUCTeX Preview because when the Preview images are activated, the line lengths are all mucked up, but if each paragraph is really only one long line, in visual line mode it all looks great whether the Preview images are activated or not. One

How to make cursor change in different modes in vim?

故事扮演 提交于 2020-01-01 17:02:14
问题 How can I make Vim change cursor in different modes so that these conditions are satisfied: Without using gconftool or such tools. I need this affect only one instance of Vim, not the whole terminal. This must be working in Gnome Terminal and GVim . PS : I have tried changing with sample in help gcr , but it only works for GVim, and not Vim in Gnome terminal. PPS : I have tested http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes, but it changed the cursor for the whole terminal.

Vim - Prevent cursor from moving when yanking to a mark

て烟熏妆下的殇ゞ 提交于 2020-01-01 16:46:21
问题 I typically use marks to cut/paste in Vim. To yank the text between lines 4 and 12, I do the following: move cursor to line 4 type mx to place a mark named x move cursor to line 12 type y'x to yank the text between lines 4 and 12 After doing this, the cursor moves back to line #4. Is there a way to make the cursor stay where it is (without moving back to the mark)? If anybody has a better ways to do the same thing, that would be great, too... Thanks in advance! Update: I used FDinoff's answer

Set iskeyword selectively

一笑奈何 提交于 2020-01-01 15:55:30
问题 Often I need to search large xml mode files for the next occurrence of the word under the cursor but preferably not if it's a tag the closing tag In the below example # is where the cursor is. Using * or # with iskeyword not including > or < will move between <Dealid> and </Dealid> . <Deali#d>4444</Dealid> ... 50 lines <Dealid>6666</Dealid> ... n lines <Dealid>5643</Dealid> I tried :set iskeyword+=< which worked fine for moving to the next match but it changed vey to include the < of the

How to change vim settings distinctively which each language?

跟風遠走 提交于 2020-01-01 12:12:50
问题 I use vim with many different languages (C, C++, Java, shell, etc.). I know vim already has it preset settings for each language, but I want to change the settings for each individual language to my personal perference. I already have a .vimrc file with settings,but I want a few more files to declare more specific settings according to the language I'm using. What are the files suppose to be called? c.vim? java.vim? Example: In C, I want my comments to be green, while in Java, I want them to

Vim and Tmux rendering error

瘦欲@ 提交于 2020-01-01 12:09:17
问题 I have a problem when using Tmux and Vim. As you can see on the picture when I use nerdtree (or irssi, actually any terminal app), I have these kind of rendering problems. Every key I type modify the entire terminal rendering. It's only a graphical bug, but it prevents me from working properly. For example, on the screenshot I submitted, nerdtree is opened. The rendering issue comes mostly when the lines are too long (wrapping) or when I have to scroll (down or up). I haven't found a way to

Postgres external editor does not execute query on savequit

烂漫一生 提交于 2020-01-01 12:06:16
问题 This is driving me slightly insane. I'm trying to edit a query using \e in postgres, but upon savequitting :wq nothing happens. Running \p , which shows what the editor saved, just comes up with a blank line, or whatever I ran most recently in the cli. It seems likethe editor is not persisting whatsoever. I'm using vim as my default editor, and I'm on psql version 9.5.4. Operating system is OSX and I'm using iterm2. The only similar problem I could find online was here, and no advice there

Is there a way (or a plugin) to make Vim generate a code outline for CSS?

馋奶兔 提交于 2020-01-01 11:48:27
问题 I was trying to install taglist (but I couldn't install ctags), but I realized that it doesn't support css, is there another way or plugin to perform this job? PS: I checked the install file of ctags, but I couldn't find any steps which looked like an installation manual. it just says: Installation Notes ================== For non-Unix platforms, simple makefiles are provided: descrip.mms For VMS using either DEC C or VAX C mk_bc3.mak For MSDOS using Borland C/C++ 3.x mk_bc5.mak For Win32