vim

How can I set up gVim as my editor on Git for Windows?

痞子三分冷 提交于 2020-08-21 06:45:52
问题 I'd like to use gVim as my editor for Git commit messages. I realize Git has its own version of vim, but it's not quite the same as gVim (along with my _vimrc settings) which I use all day anyhow. 回答1: You can use gVim with Git by configuring your core.editor to contain the path where you have gVim installed. You'll also want to run it in the foreground and not load your _viminfo file, which would position your cursor in the place where you finished your previous commit message. Taking note

Disable latex symbol conversion in vim

怎甘沉沦 提交于 2020-08-21 02:08:32
问题 The vim editor on my Kubuntu 13.04 laptop seems to have some advance feature for latex edting, i.e. it can convert latex symbols to unicode chars on the fly and hide the source code when the cursor is not on the line. This may be a great function to some people, but I find it a bit annoying. I am not sure whether this is built-in or provided by some extension, but I hope I can find out a way to disable it. My vim version is 7.4b, the list of extensions installed: clang_complete emmet-vim HTML

Vim: regular expression to match up to a string

房东的猫 提交于 2020-08-20 03:23:52
问题 What regular expression in Vim will match all characters up to no. in the below sting? foo, bar, and baz, no. 13, qux In other words the match must be foo, bar, and baz, I'm new with regular expressions, did my research here on Stack Overflow, and one suggestion is .+?(?= no.) . But it seems to work only with the regular (perl?) flavour of regular expressions, not in Vim. Please, help. Maybe there's a simpler solution to what I'm trying to achieve. My ultimate goal is to put foo, bar, and baz

In vim, how do I define a function that can be called without :call?

荒凉一梦 提交于 2020-08-18 09:06:08
问题 How do I define a function so that I can call it from command-line mode without :call in front of it? Right now, I have to do this: :call TrimWhitespace() I want to define it so that I can do this: :TrimWhitespace 回答1: This won't be a function, you should create a command instead. Check the documentation for commands ( :help user-commands in Vim). The simplest case is of a command to call a function: command! TrimWhitespace call TrimWhitespace() 来源: https://stackoverflow.com/questions/7434142

How to modify/change the vimrc file in VsCode?

空扰寡人 提交于 2020-08-09 08:13:07
问题 I am new to Vim and I have installed the Vim Extension in Vscode. I know that we can customize the default Vim Editor by modifying the vimrc file. I want to change some keybindings in the VsCode Vim extension. How to do it/Where will I find the vimrc of Vscode Vim? 回答1: Make sure you have a /.vimrc or /_vimrc file in $HOME directory and follow the follow the following steps : Open VScode and go to settings. Type vimrc Enable Use Keymappings from a .vimrc file Modify the vimrc file according

Is it possible to sort a groups of lines in vim?

我是研究僧i 提交于 2020-08-07 21:11:38
问题 As far as I know vim's :sort method will sort each line. I have some code that is in groups of 3 lines. How can I sort this? Please ignore the shitty code, it's a legacy app :'( I would like to sort by the case 'AF' line but ignore (group) the country and break line case 'AF': country = 'Afghanistan'; break;, case 'AL': country = 'Albania'; break;, case 'DZ': country = 'Algeria'; break;, case 'AS': country = 'American Samoa'; break;, case 'AD': country = 'Andorra'; break;, case 'AO': country

Is it possible to sort a groups of lines in vim?

蓝咒 提交于 2020-08-07 21:10:21
问题 As far as I know vim's :sort method will sort each line. I have some code that is in groups of 3 lines. How can I sort this? Please ignore the shitty code, it's a legacy app :'( I would like to sort by the case 'AF' line but ignore (group) the country and break line case 'AF': country = 'Afghanistan'; break;, case 'AL': country = 'Albania'; break;, case 'DZ': country = 'Algeria'; break;, case 'AS': country = 'American Samoa'; break;, case 'AD': country = 'Andorra'; break;, case 'AO': country

VIM How do I search for a <XX> single byte representation

被刻印的时光 ゝ 提交于 2020-07-17 08:04:37
问题 When I cut and paste from a Word document into VIM, quotes get translated into a-circumflex followed by <99>, where the <99> is a single byte representation. (Which I know because when I move to it, typing a single 'l' moves me right to the over all four characters). I want to do search and replace, and I know enough to find the a-cirumflex digraph using control-K a>, but I can't figure out how to search for the <99>, and searching for the literal /<99> doesn't work. So I really have two

VIM How do I search for a <XX> single byte representation

泪湿孤枕 提交于 2020-07-17 08:03:25
问题 When I cut and paste from a Word document into VIM, quotes get translated into a-circumflex followed by <99>, where the <99> is a single byte representation. (Which I know because when I move to it, typing a single 'l' moves me right to the over all four characters). I want to do search and replace, and I know enough to find the a-cirumflex digraph using control-K a>, but I can't figure out how to search for the <99>, and searching for the literal /<99> doesn't work. So I really have two

How can I quickly delete a line in VIM starting at the cursor position?

孤街浪徒 提交于 2020-07-16 11:18:46
问题 I want to be able to delete the remainder of the line I'm on starting at the cursor's position in VIM. Is there an easy command to do this? To help illustrate, this is before the command. The quick brown dog jumps over the lazy fox. ^ |----- Cursor is here. This is after the command The q ^ |----- Cursor is here. 回答1: (Edited to include commenter's good additions:) D or its equivalent d$ will delete the rest of the line and leave you in command mode. C or c$ will delete the rest of the line