vim

Why is so complicated to remap Esc to CAPS LOCK in Vim?

安稳与你 提交于 2019-12-31 08:46:07
问题 I saw the vim wiki tips and it says that in order to remap Esc to CAPS LOCK you have to edit the following windows code: REGEDIT4 [HKEY_CURRENT_USER\Keyboard Layout] "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,01,00,3a,00,00,00,00,00 Is it possible to remap Esc to CAPS LOCK by only adding or modifying lines in the _vimrc? 回答1: I recommend that you use AutoHotkey for this. You can do a per-application hotkey change: SetTitleMatchMode,2 #IfWinActive,VIM CAPSLOCK::ESC return

svn: using vim to merge conflicts

折月煮酒 提交于 2019-12-31 08:43:01
问题 I am trying see how merging in svn can be made easy. This page mentions that external tools can be used for merging. Can vim be used as the external merge tool? Some additional requirements: Files should be split horizontally/vertically to give a better view. Window titles should be set appropriately. e.g: as in 回答1: Step 1: Save the following script, e.g: merger.sh: #!/bin/sh # BASE=${1} THEIRS=${2} MINE=${3} MERGED=${4} WCPATH=${5} vimdiff $MINE $THEIRS -c ":botright split $MERGED" -c "

svn: using vim to merge conflicts

左心房为你撑大大i 提交于 2019-12-31 08:41:48
问题 I am trying see how merging in svn can be made easy. This page mentions that external tools can be used for merging. Can vim be used as the external merge tool? Some additional requirements: Files should be split horizontally/vertically to give a better view. Window titles should be set appropriately. e.g: as in 回答1: Step 1: Save the following script, e.g: merger.sh: #!/bin/sh # BASE=${1} THEIRS=${2} MINE=${3} MERGED=${4} WCPATH=${5} vimdiff $MINE $THEIRS -c ":botright split $MERGED" -c "

Open a file in a tab in vim in readonly mode

本小妞迷上赌 提交于 2019-12-31 08:30:34
问题 I'm aware of opening files in readonly mode from shell using vim -R , but how to open a file from inside vim in a separate tab ( :tabe <filename> ) in readonly mode? Thanks for your time. 回答1: To open a file in read only mode in a new tab, use tab sview /path/to/file To open the file in the same pane, (without using a new window or tab), use view /path/to/file Note that tab view /path/to/file does not open a new tab. 回答2: You can open a file in readonly mode from inside vim : :view /path/to

Vim: How to go to the declaration (of a class, method, function, variable, etc)

£可爱£侵袭症+ 提交于 2019-12-31 08:29:07
问题 Right now I am working on a file which uses many classes, methods, functions, variables, etc. Is it possible to go to the declaration of all of them? Please, take into account that some of those declarations are in the same file but others are in other files (which may not be opened and you do not know where the declarations are but they do exist). What would happen if the declaration is one level up in the directory? and what about if it is one level down? Is this done in a different way

How to debug Erlang code?

拜拜、爱过 提交于 2019-12-31 08:28:10
问题 I have some Ruby and Java background and I'm accustomed to having exact numbers of lines in the error logs. So, if there is an error in the compiled code, I will see the number of line which caused the exception in the console output. Like in this Ruby example: my_ruby_code.rb:13:in `/': divided by 0 (ZeroDivisionError) from my_ruby_code.rb:13 It's simple and fast - I just go to the line number 13 and fix the error. On the contrary, Erlang just says something like: ** exception error: no

Has anyone found a good set of python plugins for vim — specifically module completion?

眉间皱痕 提交于 2019-12-31 08:12:26
问题 I'm looking for a suite of plugins that can help me finally switch over to vim full-time. Right now I'm using Komodo with some good success, but their vim bindings have enough little errors that I'm tired of it. What I do love in Komodo, though, is the code completion. So, here's what I'm looking for (ordered by importance). Code completion, meaning: the ability to code complete modules/functions/etc. in any module that's on the pythonpath, not just system modules . Bonus points for showing

VIM: Save and Run at the same time?

感情迁移 提交于 2019-12-31 08:03:22
问题 I do a lot of Python quick simulation stuff and I'm constantly saving (:w) and then running (:!!). I'm wondering, is there a way to combine these actions. Maybe a "save and run" command. Thanks for your help. 回答1: Option 1: Write a function similar to this and place it in your startup settings: function myex() execute ':w' execute ':!!' endfunction You could even map a key combo to it-- look a the docs. Option 2 (better): Look at the documentation for remapping keystrokes - you may be able to

What is the recommended way to use Vim folding for Python code

别来无恙 提交于 2019-12-31 07:52:26
问题 I am interested in enabling code folding in Vim for Python code. I have noticed multiple ways to do so. Does anyone have a preferred way to do Python code folding in Vim? I.e, Do you have a particular Vim plugin that you use and like? Do you use manual folding or do you place markers in comments? Any other recommended ways to do code folding for Python in Vim? 回答1: Personally I can't convince myself to litter my code with the markers. I've become pretty used to (and efficient) at using indent

Vertical vim cursor in command mode

半城伤御伤魂 提交于 2019-12-31 04:08:10
问题 Im on mac and I have my terminal cursor set to the vertical bar option. However in vim command mode the cursor is the vertical bar but it wont let me use hjkl to go to the end of the line, it always stops right before the end. This is especially annoying because you have to use the arrow keys in insert mode to make the cursor go the end of the line. Any fix would be appreciated eg: hello worl | d , what I want is hello world | 回答1: I think you're looking for set virtualedit=onemore . From