vim

set pastetoggle not working

北战南征 提交于 2019-12-22 08:40:10
问题 My vim setup( https://github.com/aaronjorbin/.vim ) contains set pastetoggle=<F2> yet fn+F2 (when vim is running in terminal) causes vim to enter insert mode and output a Q on it's own line (same behavior when I am already in insert mode). This is the same if I am working on my local machine or if I have sshed into another server. In iterm2, nothing happens when I am in normal or visual mode. When I am in insert mode, <F2> is inserted. My config works perfectly well on my mac mini and linux

How do I write a vim function to output the result of a system command?

老子叫甜甜 提交于 2019-12-22 08:37:39
问题 What I have so far: function! GetMarker() return system('echo $random `date` | md5sum | cut -d" " -f1') endfunction I would like to be able to do a :getmarker and have it insert the output of that system command at my cursor, with no new lines. Also what is the difference between function! and function ? Edit: before any of you ask, I need the random string to mark sections in my code so I can find them again by referencing my notes in my todo wiki. 回答1: Edit1. Take two. Trying to absorb the

showing single space invisible character in vim

依然范特西╮ 提交于 2019-12-22 08:35:08
问题 I have added set listchars=tab:»\,trail:·,extends:#,nbsp:. for showing invisible characters. It is working for tab extends but not working for nbsp, I have read the help for :set listchars and tried with examples given there, but still I am not getting dot character for single space character. what else I have to do for this. Any suggestion. Thanks 回答1: Please be careful with the backslashes. set listchars=tab:>\\,trail:·,extends:#,nbsp:. This works as expected. However, one should note that

in gvim, how to disable scrollbar when taglist is shown?

不羁岁月 提交于 2019-12-22 08:24:52
问题 i've set "set guioptions-=l", but whenever taglist is enabled the left hand scrollbar is still shown and cannot be disabled (right hand scrollbar toggles fine). also, vim wont maximize on start if taglist is enabled. if the above can't be fixed, are there any taglist altenatives. 回答1: Make sure you have guioptions-=L set too. If it's not removed then you'll get a left hand scrollbar whenever there's a vertical split. 回答2: I use this in my .gvimrc. set guioptions=Ace 来源: https://stackoverflow

how to make syntastic with html tidy aware of ionic tags?

独自空忆成欢 提交于 2019-12-22 08:08:34
问题 I'm trying to edit an ionic application with vim that has syntastic enabled using html tidy. Unfortunately, I'm getting a load of errors. How can I make html tidy aware of ionic tags, or failing that make it ignore them so that I don't receive errors like this: www/index.html|26 col 5 error| <ion-pane> is not recognized! ... www/index.html|24 col 3 warning| <body> proprietary attribute "ng-app" 回答1: The solution for me was to set the following: let g:syntastic_html_tidy_ignore_errors=["<ion-"

ctrl-] is not working for tcl code navigation

穿精又带淫゛_ 提交于 2019-12-22 08:00:01
问题 I am new to Tcl/Tk, I am using Vim to code and browsing. The syntax highlighting for Tcl/Tk is working fine. The jump into the function using Ctrl ] doesnt work it gives me an message saying that " cstag: tag not found ". I have installed ctags and generated tags using " ctags -R *.tcl ". I have extensively used namespaces in Tcl/Tk code. The tags generated in tags file is something like this " namespace1::function1 ". How do i get Ctrl ] (and Ctrl T for popping from stack) working in Vim?

How to repeatedly add text on both sides of a word in vim?

折月煮酒 提交于 2019-12-22 07:47:45
问题 I have a bunch of local variable references in a Python script that I want to pull from a dictionary instead. So, I need to essentially change foo , bar , and others into env['foo'] , env['bar'] and so on. Do I need to write a regular expression and match each variable name to transform, or is there a more direct approach that I could just repeat with the . command? 回答1: You can use a macro: type these commands in one go (with spacing just to insert comments) " first move to start of the

How to repeatedly add text on both sides of a word in vim?

那年仲夏 提交于 2019-12-22 07:47:09
问题 I have a bunch of local variable references in a Python script that I want to pull from a dictionary instead. So, I need to essentially change foo , bar , and others into env['foo'] , env['bar'] and so on. Do I need to write a regular expression and match each variable name to transform, or is there a more direct approach that I could just repeat with the . command? 回答1: You can use a macro: type these commands in one go (with spacing just to insert comments) " first move to start of the

Can't Map <S-CR> in Vim

£可爱£侵袭症+ 提交于 2019-12-22 06:56:59
问题 Got my first Mac over the weekend, and I'm trying to get adjusted. This line in my vimrc, which worked on my windows, won't work with vim through iTerm inoremap <S-CR> <Esc> I'm wanting Shift-Enter to act as Escape in insert mode. I've tried using Enter and Return, but that requires me to use the Fn key on my Macbook, which is just as annoying as the escape key. I Appreciate the help! 回答1: The problem here is with the terminal emulation. Most terminals cannot distinguish between non-printing

Can I change vim completion preview window height?

坚强是说给别人听的谎言 提交于 2019-12-22 06:36:56
问题 I'm using Eclimd for completion. it generates a lot of helpful info about function, but in 1-line preview window it looks messy. (same window uses by omni-completion) So: Is there any way to change default preview window height? Make preview-popup instead of preview-window? 回答1: I am facing problems with 'previewheight' too so I came up with the following work around: set previewheight=50 au BufEnter ?* call PreviewHeightWorkAround() func PreviewHeightWorkAround() if &previewwindow exec