vim

When navigating through word-wrapped text in VIM, how to make the selector move onto wrapped line sections?

自作多情 提交于 2019-12-19 21:45:04
问题 The behaviour I want is the behaviour in most text editors and office applications (that aren't designed with programmers in mind). This makes it quicker to get to the centre of large paragraphs. Thanks. 回答1: I'm not certain that I understand your question, but try the commands gj and gk , instead of j and k . I think they do what you want. I've put together a screencast with a few tips for working with 'soft wrapped' text (which I guess is the same as 'word-wrapped' text). 来源: https:/

Powerline on Mac OS X not working as expected

允我心安 提交于 2019-12-19 19:51:30
问题 as the image shows , after installing the powerline for vim, some symbols are not working. For searching google i thought there maybe problems with the patch fonts. But after trying i cannot solve this problem. Could someone help me? Environment: Mac OSX 10.8.2, iTerm2. 回答1: See “Custom font not working for iTerm2.” issue. 回答2: --For all the noobs, with attention deficit, like my self. I had the same issue, the solution was much more basic than than installing the fonts, but was not mentioned

Vim - Capture strings on Search and use on Replace

若如初见. 提交于 2019-12-19 19:12:35
问题 I have a css selector such as: #page-site-index .toolbar .items { How do I capture the ".toolbar .items" part and use it on Replace part of Vim S&R, so this selector can turn into: #page-site-index .toolbar .items, #page-site-login .toolbar .items { Something like: %s:/#page-site-index \(.toolbar .items\)/#page-site-index (the captured string), #page-site-login (the captured string)/g Btw, I'm using the terminal version of Vim. 回答1: Use \1 ... See the wiki here: http://vim.wikia.com/wiki

Vim text coloring

被刻印的时光 ゝ 提交于 2019-12-19 17:41:27
问题 I use echo -e to color my scripts output, it works fine when using standard output. But when I redirect the output to a file, vim doesn't show the colors, instead of that it shows signs like this ^[[ example: echo -e "\e[32m Green message\e[0m"; echo -e "\e[31m Red message\e[0m"; with vim : ^[[32m Green message^[[0m ^[[31m Red message^[[0m How to fix this. NB : cat shows the colors too!! 回答1: Use either the AnsiEsc Plugin by Dr. Chip or my Colorizer plugin. Both should be able to color those

gVim displays every file with an asterisk on the right (and bold)?

余生颓废 提交于 2019-12-19 17:39:08
问题 It looks like this: I'm not sure but I think it started to happen when I reinstalled LAMP (Ubuntu). All the files used to look like the ones below (no bold and no asterisk). Any suggestions? 回答1: NERDTree uses the asterisk to indicate an item is executable, I believe. At least for me, it shows up on all my .bat and .exe files. 回答2: That looks like NERDTree. Maybe there is a NERDTree setting regarding it. Suggestions: See if the permissions or settings (do they have chmod +x) are different on

Vim: Pathogen not loading

巧了我就是萌 提交于 2019-12-19 16:34:18
问题 I've recently moved to a new MacBook, taking my vim dot files with me. Whilst Pathogen works fine on my old MacBook, it's not loading at all on my new one. I've now reinstalled Pathogen from scratch and it's not working with the most basic setup either. I've tried both iTerm and Terminal.app in case it was the newer version of iTerm I'm running that was the issue. .vimrc .vim Any ideas? :) 回答1: OK, this is a bit embarrassing :$ As it turns out mMontu gave me the prod in the right direction by

Reusing the previous range in ex commands in VIM

大城市里の小女人 提交于 2019-12-19 15:34:13
问题 Is it possible to reuse the range of ex commands in VIM? As an example, I can write (copy) lines 4 to 10 from my current file to a new file using the following command: :4,10w foo/bar.txt But what I really want to do is move the lines to a new file. I can do this like so: :4,10w foo/bar.txt :4,10d But it's a bit annoying to have to type 4,10 both times. So I have two questions: Generally , Is there a way to reference the previously used range in ex commands? Specifically , if there is not a

slimv segfaulting on OS X Lion

廉价感情. 提交于 2019-12-19 11:28:36
问题 I have been trying to get slimv (http://www.vim.org/scripts/script.php?script_id=2531) working for a while now, but I am really not sure what else I can do. I am running vim 7.3 compiled with python support, using clisp (sbcl is showing the same issue though) on os x lion. I pulled the latest version of slimv off of vim.org. When I load a lisp file, echo g:slimv_loaded returns 1, but I do not get a second window with the repl. When I hit any of the keybindings, a new terminal window opens,

Searching using regex in Vim or elsewhere

巧了我就是萌 提交于 2019-12-19 10:13:50
问题 I'm looking for a way to search for the text representation of a series of hexadecimal numbers. I search in the hex dump of a binary file. 0x000001A0: 36 5B 09 76 99 31 55 09 78 99 34 51 49 BF E0 03 0x000001B0: 28 0B 0A 03 0B E0 07 28 0B 0A 03 0B 49 58 09 35 The issue is that the pattern may roll over onto the next line. For instance, in the above two lines, I wouldn't be able to immediately search for 03 28 0B because it is on two lines. I have been told from recent posting that regex is the

Vim 多行剪切、复制和删除

て烟熏妆下的殇ゞ 提交于 2019-12-19 10:12:25
剪切 快捷键方式: dd:剪切光标所处当前行 n + dd:剪切光标所在行及以下共 n 行 按 p 粘贴在光标所在行 命令行方式: 例如剪切1到10行,并粘贴在12行处: 1,10 m 12 复制 快捷键方式: yy:复制光标所处当前行 n + yy:复制光标所在行及以下共 n 行 按 p 粘贴在光标所在行 命令行方式: 例如复制1到10行,并粘贴在12行处: 1,10 co 12 删除 快捷键方式: dd:删除光标所处当前行 n + dd:删除光标所在行及以下共 n 行 命令行方式: 例如删除1到10行: 1,10 de 进入命令行 "shift + :" :进入命令行模式 "set nu" :显示行号 "etc + etc" :退出命令行模式 实际情况下,按 p 粘贴时有的情况是粘贴在光标所在的下一行,自己操作下便可知晓。 来源: https://www.cnblogs.com/GyForever1004/p/8445804.html