Search Results

Search found 1329 results on 54 pages for 'vim'.

Page 9/54 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Vim - ab for each language

    - by nXqd
    I try to write :ab in Vim for faster coding but the question is can I write ab for each language . Like in HTML : I write begincode : I'll be HTML DOC TYPE in C++ : It'll be int main () { return 1; }; I'm a new beginner in Vim and I miss intellisense in visual studio, can I have it in Vim . I mean not only for C++, but another language too :) Thanks for reading .

    Read the article

  • Invert regexp in vim

    - by Chris J
    There's a few "how do I invert a regexp" questions here on stackoverflow, but I can't find one for vim (if it does exist, by goggle-fu is lacking today). In essence I want to match all non-printable characters and delete them. I could write a short script, or drop to a shell and use tr or something similar to delete, but a vim solution would be dandy :-) Vim has the atom \p to match printable characters, however trying to do this :s/[^\p]//g to match the inverse failed and just left me with every 'p' in the file. I've seen the (?!xxx) sequence in other questions, and vim seems to not recognise this sequence. I've not found seen an atom for non-printable chars. In the interim, I'm going to drop to external tools, but if anyone's got any trick up their sleeve to do this, it'd be welcome :-) Ta!

    Read the article

  • Unidentifiable Vim Keymap

    - by asdf.qwer
    Hi I'm trying to get rid of a pesky keymapping in vim, namely \c The mapping is only loaded for latex files, so it should be related to the latex-suite. It's annoying, because it can't type \cite without this keymap ruining everything. I can unmap it "manually" by typing: :unmap! \c But this doesn't work when I put that into my ~/.vimrc file because it says there's no such keymap. I think this is because the keymap is loaded after .vimrc, although I'm not sure. I've tried locate in bash to locate all files on my system that start have "vim" in their filename, and subsequently grep keyword $filename to find all references to keyword that should be relevant. The keyword I search for is "Traditional" because that's what the mapping is called (that's what I find by typing :map! in vim normal mode). It finds some entries that contain "Traditional" but nothing that corresponds to \c, except in the file: ~/.gnome2/gvim-sA9LOO-session.vim But this file is not used by vim when starting up, as far as I know. Anyone know any fix?

    Read the article

  • How to maintain tabs when pasting in Vim

    - by Ant Wilson
    I use the tab key to indent my python code in Vim, but whenever I copy and paste a block Vim replaces every tab with 4 spaces, which raises an IndentationError I tried setting :set paste as suggested in related questions but it makes no difference Other sites suggest pasting 'tabless' code and using the visual editor to re-indent, but this is asking for trouble when it comes to large blocks Are there any settings I can apply to vim to maintain tabs on copy/paste? Thanks for any help with this :) edit: I am copying and pasting within vim using the standard gnome-terminal techniques (ctrl+shift+c / mouse etc.) my .vimrc is: syntax on set ts=4 if has("terminfo") let &t_Co=8 let &t_Sf="\e[3%p1%dm" let &t_Sb="\e[4%p1%dm" else let &t_Co=8 let &t_Sf="\e[3%dm" let &t_Sb="\e[4%dm" endif I looked up that ts - Sets tab stops to n for text input, but don't know what value would maintain a tab character

    Read the article

  • Coda Clips for Vim

    - by XLR3204S
    I'm currently trying to switch from Coda (a Mac IDE) to Vim. One thing I loved about Coda and my knowledge of Vim cannot replace were the so-called "clips". Basically, you type, say, "new", press TAB, and the text is replaced with a basic XHTML page. And you can add as many keyword/clips combinations as you want. The most I could get with Vim so far was to create a new file containing my clip, and then use :r FILE in Vim in order to get it inserted, but this is not a very elegant solution, as I'd have to carry these clips around in every directory I have a file I want to use my clips with. So assuming I've explained things properly, what would be my choices?

    Read the article

  • How do you use vim's quickfix feature?

    - by hora
    I'm a pretty new Vim user and I've found that its learning curve is quite steep (at least for me). I just installed this vim script for JavaScriptLint error checking, which shows errors in vim's quickfix window once I save a buffer. However, I don't know what to do next.. How do I 'scroll' through all the errors? How do I close the quickfix 'window'? How do I get it to check for errors after I've made changes to my code? I've looked at the vim quickfix docs but the amount of commands are overwhelming and I can't seem to find what I want. Any help would be appreciated. A side question: is there any way to have javascriptlint check for js errors for code residing in a .html file? Thanks!

    Read the article

  • VIM comma is missing in insert mode

    - by Tamás Szelei
    Hi folks, I'm a VIM beginner, and I have a weird problem. I started using vim in a terminal emulator, but today I moved to gVim. Then I realized that I cannot write a comma in Insert mode! I tried :map ,, :imap , both said no mapping found. THen I tried :nomap , and :inomap , both without any luck. As writing the commands, I am able to write the comma, but not in insert mode. What can be the problem? Some details: I'm running a freshly installed ubuntu 9.04 system, with an english keyboard, but using a hungarian layout. I am able to write a comma in vim when writing into the "command line" of vim, after pressing : in command mode.

    Read the article

  • Vim (terminal) - copy to x clipboard and paste while suspeneded

    - by gmatt
    I have vimx installed, so I can copy in vimx to the x clipboard by using "+y and the like, which works well as long as I can keep the current vimx running. However, I also love to be able to switch to the current running shell with ctrl-z and be able to paste what I copied from vim into the shell. Does anyone know how to do this, because as soon as I suspend vim with ctr-z the x-clipboard becomes empty, until I put vim into the fg again.

    Read the article

  • How do I turn off automatic saving of a vim file with a ~ suffix

    - by Leonard
    In my environment, I share vim configuration with other developers (and have my own configuration additions as well) in various .vimrc files. Some places in the environment, I edit a file in vim and automagically a copy of that file with a trailing tilde suffix appears. What vim options control this? I'd like to turn the feature off, as it just clutters up my directories and spoils auto-completion on the command line. Thanks.

    Read the article

  • Find what filetype is loaded in vim

    - by ruturaj
    As soon as I load any file in vim, It'll try to detect the file and color-highlight it if possible. I want to know a vim command that will tell me which ftplugin or Filetype plugin / filetype is vim considering to highlight the file.

    Read the article

  • Scripting vim to Run Perltidy on a Buffer

    - by rjray
    At my current job, we have coding-style standards that are different from the ones I normally follow. Fortunately, we have a canned RC file for perltidy that I can apply to reformat files before I submit them to our review process. I have code for emacs that I use to run a command over a buffer and replace the buffer with the output, which I have adapted for this. But I sometimes alternate between emacs and vim, and would like to have the same capabilities there. I'm sure that this or something similar is simple and had been done and re-done many times over. But I've not had much luck finding any examples of vim-script that seem to do what I need. Which is, in essence, to be able to hit a key combo (like Ctrl-F6, what I use in emacs) and have the buffer be reformatted in-place by perltidy. While I'm a comfortable vim-user, I'm completely clueless at writing this sort of thing for vim.

    Read the article

  • Useful Vim features

    - by Craig H
    Vim is my editor of choice, and I feel I am above average in my use of it. I do recognize, though, that the feature list of vim is huge. With this in mind, I was wondering what features you vim users out there use on a regular basis.

    Read the article

  • How to change word recognition in vim spell?

    - by David
    I like that vim 7.0 supports spell checking via :set spell, and I like that it by default only checks comments and text strings in my C code. But I wanted to find a way to change the behavior so that vim will know that when I write words containing underscores, I don't want that word spell checked. The problem is that I often will refer to variable or function names in my comments, and so right now vim thinks that each piece of text that isn't a complete correct word is a spelling error. Eg. /* The variable proj_abc_ptr is used in function do_func_stuff' */ Most of the time, the pieces seperated by underscores are complete words, but other times they are abbreviations that I would prefer not to add to a word list. Is there any global way to tell vim to include _'s as part of the word when spell checking?

    Read the article

  • Mapping Left Alt key in vim?

    - by Yogesh Arora
    I am able to map the key combination Right Alt+Left Arrow with <a-left> or by <m-left>. But I am not able to map the Left Alt key. Is there a way to do that? Edit: Just to clarity <a-left> means Alt+Left Arrow. The important question here is what is difference between Left Alt and Right Alt from the perspective of keymappings in Vim?

    Read the article

  • How to remap a NERDTree shortcut in VIM

    - by btelles
    Hi There, I use the Dvorak keyboard layout with VIM, and the 't' key is the 'up' motion when editing a regular file. The problem is that NERDTree remaps 't' to open files in a new tab. How can I undo that mapping and use 't' for the up motion in NERDTree? Here are the relevant lines from my vimrc file and from the NERDTree plugin. My .vimrc: no t k NERDTree plugin file: exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenInTab ." :call <SID>openInNewTab(0)<cr>" call s:initVariable("g:NERDTreeMapOpenInTab", "t") let @h=@h."\" ". g:NERDTreeMapOpenInTab.": open in new tab\n"

    Read the article

  • Emulating vim directional key using AutoHotKey

    - by Reza
    Currently I am using following code for changing keyboard layout: //vim.ahk CapsLock::Send, {CTRLDOWN}{SHIFTDOWN}{SHIFTUP}{CTRLUP}{CTRLUP} return !CapsLock::CapsLock CapsLock & j :: Send {Down} CapsLock & k :: Send {Up} CapsLock & h :: Send {Left} CapsLock & l :: Send {right} CapsLock & p :: Send {PGUP} CapsLock & `; :: Send {PGDN} CapsLock & a :: Send {home} CapsLock & e :: Send {end} Is this code stable enough?

    Read the article

  • Vim */dyn support

    - by galymzhan
    What does mean the plus sign before */dyn in the :version command's output, e.g.: +python/dyn +python3/dyn +ruby/dyn +tcl/dyn I didn't find any useful documentation on it. When I run :echo has('python3') Vim returns 0. When I run :python3 print('hi') it says E370: Could not load library python31.dll meaning I should install python (as I understand). So I just can't see the difference between -*/dyn and +*/dyn. What does plus sign give to us? Also what's the difference from dyn-less feature, e.g. +python?

    Read the article

  • Vim's relativenumber setting and multiple buffers

    - by connrs
    I like the relative number setting. I'm refactoring code at the moment (translation: explodicating 5 year old terrible methods and replacing them with nice code) and I find it useful to have the setting active on files as I open them I frequently either open multiple buffers or use a client/server vim to contain all my open buffers/files and have noticed that the relative number only seems to apply to the first buffer (and not the remaining buffers when I have set rnu in my .vimrc file.) Is it expected behaviour for rnu to only initially apply to the first buffer until you manually set it?

    Read the article

  • over Windows terminal change cursor width or color in Vim depending on mode

    - by INTPnerd
    I am using PuTTY to connect over SSH to an Ubuntu server from my Windows 7 workstation. Once connected I am using the Vim installation from the Ubuntu server to edit files. I want the cursor to change when I go into and out of insert mode. Part of my .vimrc file is like this but it is not changing the cursor: if &term =~ "xterm" echo "xTerm!!inate!" let &t_SI = "\<Esc>]12;purple\x7" let &t_EI = "\<Esc>]12;blue\x7" endif I know that the if statement is executing because of the echo. EDIT: Actually I would prefer to change the cursor to be a vertical line like you can in the PuTTY settings rather than change the color, or maybe even do both. But just changing the color would be a lot better than nothing. Also I am willing to change terminals if there is another Windows 7 Professionsal 64 bit compatible terminal that can do this (preferably something free). Maybe Poderosa can do this?

    Read the article

  • Fixing the position of items in vim's statusline

    - by ldigas
    My statusline looks something like this: set statusline+=%m set statusline+=b%n: " set statusline+=%f set statusline+=%F set statusline+=%R set statusline+=%Y set statusline+=\ set statusline+=[ set statusline+=row\ %l/%L set statusline+=,\ " set statusline+=column\ %c\ (%v) set statusline+=column\ %v\ (%c) set statusline+=] which, on an average day, when there is no clouds, gives something like this: [-]b3:options.txt,RO,HELP [row 6291/7778, column 42 (29)] Now, when I go about splitting windows, and opening different files, some of them modified, some of them not, the things in the statusline start to wiggle back and forth, and it annoys me to no end. I saw in vim's help (:help 'statusline) that one can set a fixed width of some items. How would you go about fixing the above items in a way, that if one item is missing, or no matter of its width, that it doesn't affect the other ones ? (i.e. so I can always look at a known position and know what is there ... not move my eyes left and right searching for the thing I need).

    Read the article

  • Problems with vim/locale as non-root user on Solaris

    - by Lyle
    I do some work on a Solaris 10 machine, and my .vimrc is set up to show unicode characters for tabs and line endings: set listchars=tab:?\ ,eol:¬ This works out of the box on my OS X machine. On Linux as well as Solaris I get the following error when I start vim: Error detected while processing /home/lhanson/.vimrc: line 17: E474: Invalid argument: listchars=tab:?~V?\ ,eol:¬ I solved this on my Linux box by setting LANG=en_US.utf8 ('locale -a' shows this as being an option). On Solaris, however, 'locale -a' shows the following: C POSIX iso_8859_1 Setting LANG to C or POSIX yields the same error, and even though iso_8859_1 probably wouldn't work it doesn't successfully change the locale anyway. As a non-root user, is there any way I can have my unicode characters show up?

    Read the article

  • vim NERDTree shortcut to an existing function

    - by Ned Batchelder
    I want to use right-arrow to open a node in NERDtree. I see there is NERDTreeAddKeyMap, but I'm too much of a vimscript newb to know how to invoke it properly. I want right-arrow to invoke activateNode. I've done it by adding this line into NERD_tree.vim itself: exec "nnoremap <silent> <buffer> <Right> :call <SID>activateNode(0)<cr>" but I want to do it the right way in my .vimrc

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >