vim-plugin

mapping enter key to newline and tab in vim

北战南征 提交于 2019-12-11 20:16:24
问题 Whenever I press the enter key, indicating an end of paragraph, vim should automatically insert another new line, and insert a tab space in the next line. All this is to denote that I am ready to type the next paragraph. 回答1: I agree with the comments saying that this is not a good idea to do, but the following works for me: inoremap <buffer> <cr> <cr><cr><tab> 来源: https://stackoverflow.com/questions/13834346/mapping-enter-key-to-newline-and-tab-in-vim

Vim YouCompleteMe enable .tex filetype

扶醉桌前 提交于 2019-12-11 16:46:39
问题 When I open a *.tex file with Vim, filetypes is read as plaintex (returned by set ft? ) by YCM. So I added in .vimrc : let g:ycm_filetype_blacklist = {'plaintex' : 1} But nothing had changed. Here I want that filetype .tex is read as tex type ( set ft=tex ). How to define it with YCM options? 回答1: Does YCM set the 'filetype' option? If you want it set to tex , then check where it was set: :verbose set ft? I bet it is set in $VIMRUNTIME/filetype.vim , in which case it is my fault. Luckily, I

Vim YouCompleteMe Python subclasses are not detected on TAB-completion in Arch Linux

寵の児 提交于 2019-12-11 16:29:59
问题 I can TAB-complete current open file variables, paths & globals, but my python subclasses are not detected on TAB completion. For instance, import os # os is built-in library. os. # ycm does not complete members of this class. It has been 48h that I'm searching the solution. My /usr/bin/python -> /usr/bin/python2.7, all the tests pass 100% and the build was successful. > uname -r 4.0.5-1-ARCH I tried installing packages specific to Arch Linux from repositories and they don't seem to work. At

VIM Rainbow Parenthese autostart

送分小仙女□ 提交于 2019-12-11 14:53:07
问题 I'm using the rainbow_parentheses plugin and I'm wishing for it start on VIM start. Currently, on start-up, nothing changes; when Load_Rainbow is called manually after start-up, it works. The relevant vimrc section is as follows: " Rainbow Parentheses options { function! Config_Rainbow() call rainbow_parentheses#load(0) call rainbow_parentheses#load(1) call rainbow_parentheses#load(2) endfunction function! Load_Rainbow() call rainbow_parentheses#activate() endfunction augroup TastetheRainbow

Vim spell checking latex's newcommand definition

五迷三道 提交于 2019-12-11 04:34:46
问题 My problem is simple and I hope the solution too: vim-spell plugin doesn't colorize the incorrect words in \newcommand 's definition in LaTeX files: \newcommand{\mycommand}{Helllo World} The Helllo will not be red. When I delete the parentheses around Helllo world it's marked as a bad word. 回答1: I was trying to solve a problem related with spelling in latex files and I got help in the vim_use group. Please read the messages in google groups interface to get the full details. Try adding the

Vim: set 'cursor' keys hjkl to wasd

依然范特西╮ 提交于 2019-12-11 04:17:15
问题 I admit that I'm not an expert vim user so forgive me not providing previous attempts! I wish to overwrite/remap the basic vi / vim (and gvim ) "cursor keys" hjkl to the ordinary "gamer layout" wasd (w-up, a-left, s-down, d-right). Moreover: I know that "w", "a", "s" and "d" are important keys in vim so I came up with the idea to remap hjkl to ALT + wasd . Have to configure .vimrc? Or is there some plugin? Can you help me? 回答1: Map your Alt + aswd to hjkl; in your .vimrc noremap <A-a> h

vimscript detect piped input

情到浓时终转凉″ 提交于 2019-12-11 04:15:04
问题 It is easy to use vimscript to determine if a filename was specified to vim by using argc() . Is there a way to determine if the - flag was given to specify piped input was given to vim? It doesn't count piped input as a filename and argc() is empty. Edit Thanks to the wonderful accepted answer below, I have a way to open NerdTree if there are no filenames and stndin is not being used. let wmuse_nt = 0 autocmd StdinReadPost * let wmuse_nt = 1 autocmd vimenter * if !argc() && wmuse_nt == 0 |

How to get list of files which are currently being diffed in vim

感情迁移 提交于 2019-12-10 18:18:00
问题 I am writing a vim plugin in which i need to determine all those files which are currently being diffed. That is the ones for which diff is set. I have been going through the manual but could not find much. Is it possible to do this. This question is actually related to question how-to-detect-the-position-of-window-in-vim. In that question i was trying to get the position of window, so as to detect which one of the diffs is the right one and which is left one. The solution i got was to use

Vim: Is vertical tab list possible?

梦想与她 提交于 2019-12-10 02:38:02
问题 Is it possible to have vim's tab list presented vertically on the left side of the editor? It'd be really helpful, but I haven't managed find any plugins that can do this yet. (do i suck at google?) 回答1: It seems to me as though you are using tabs as buffers. I'd politely ask that you take a second to read this answer if that is indeed the case. I'd also strongly urge you to change this habit. However, if you are indeed using tabs for this purpose you could potentially get a 'vertical tab