Search Results

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

Page 23/54 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Something remapped <C-w> in Vim, how do I reclaim it?

    - by blackrobot
    I've been adding a lot of things to my Vim configuration, and apparently one of the plugins I've installed is reclaiming . Whenever I use that key combination, it shows this error: "E784: Cannot close last tab page". Is there a way to reclaim 's functionality without disabling the plugins? I mainly use it for switching between view panes in a split window.

    Read the article

  • Is there a way to "lock" the viewport in vim?

    - by breadjesus
    I recently started using Vim with NERDTree. The annoying thing is when I close the buffer, NERDTree expands to fill the rest of the screen, and I have to open another file and reopen NERDTree to get it back to the old layout. Is there a way to "lock" NERDTree in place? Ideally, closing a buffer would replace it with another buffer that's hidden, or open a new blank buffer if no other buffers are open. Thanks!

    Read the article

  • Vim step-by-step: How do you line up arbitrary text by arbitrary delimiter?

    - by dreftymac
    Background: There are a lot of great tutorials and "tricks" pages for Vim, but one thing that is very difficult is to find specific instructions on how to do some arbitrary thing that one can easily do in one's own familiar text editor IDE. Therefore I am asking for step by step instructions on how you I would do something in Vim that I already know how to do in other text editors. I like Vim and the great built-in help and numerous on-line tutorials, but sometimes a human has to break down and ask another human. Question: Suppose I have the following code in my file, how can I use Vim to get from BEFORE, to AFTER? BEFORE: Lorem ipsum dolor | sit amet, consectetur | adipisicing elit, sed do eiusmod | tempor incididunt | ut labore et | dolore magna aliqua. | Ut enim ad minim veniam, quis nostrud | exercitation ullamco | laboris nisi ut | aliquip ex ea commodo | consequat. Duis aute irure AFTER: Lorem ipsum dolor | sit amet, consectetur | adipisicing elit, sed do eiusmod | tempor incididunt | ut labore et | dolore magna aliqua. | Ut enim ad minim veniam, quis nostrud | exercitation ullamco | laboris nisi ut | aliquip ex ea commodo | consequat. Duis aute irure

    Read the article

  • Unix console becomes inactive after closing vim

    - by gotts
    user@laptop:~$ locate file.ext | xargs vim -p Vim: Warning: Input is not from a terminal 2 files to edit user@laptop:~$ After finding files and modifying them in vim I want to save them and continue to work in unix console but I can't do that. After vim close console just halts. No activity on any keypress. The only workaround is to close console tab and create a new one. How can I solve this problem?

    Read the article

  • How to select the first ocurrence in the auto-completion menu by pressing Enter?

    - by janoChen
    Every time there's is a pop up menu. I select the first occurrence and press enter but nothing happens (the word is not completed with he selected occurrence). The only way is to press Tab until you reach the term for a second time. Is there a way of selecting the first occurrence pressing Enter (or other Vim hotkey)? My .vimrc: " SHORTCUTS nnoremap <F4> :set filetype=html<CR> nnoremap <F5> :set filetype=php<CR> nnoremap <F3> :TlistToggle<CR> " press space to turn off highlighting and clear any message already displayed. nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR> " set buffers commands nnoremap <silent> <M-F8> :BufExplorer<CR> nnoremap <silent> <F8> :bn<CR> nnoremap <silent> <S-F8> :bp<CR> " open NERDTree with start directory: D:\wamp\www nnoremap <F9> :NERDTree /home/alex/www<CR> " open MRU nnoremap <F10> :MRU<CR> " open current file (silently) nnoremap <silent> <F11> :let old_reg=@"<CR>:let @"=substitute(expand("%:p"), "/", "\\", "g")<CR>:silent!!cmd /cstart <C-R><C-R>"<CR><CR>:let @"=old_reg<CR> " open current file in localhost (default browser) nnoremap <F12> :! start "http://localhost" file:///"%:p""<CR> " open Vim's default Explorer nnoremap <silent> <F2> :Explore<CR> nnoremap <C-F2> :%s/\.html/.php/g<CR> " REMAPPING " map leader to , let mapleader = "," " remap ` to ' nnoremap ' ` nnoremap ` ' " remap increment numbers nnoremap <C-kPlus> <C-A> " COMPRESSION function Js_css_compress () let cwd = expand('<afile>:p:h') let nam = expand('<afile>:t:r') let ext = expand('<afile>:e') if -1 == match(nam, "[\._]src$") let minfname = nam.".min.".ext else let minfname = substitute(nam, "[\._]src$", "", "g").".".ext endif if ext == 'less' if executable('lessc') cal system( 'lessc '.cwd.'/'.nam.'.'.ext.' &') endif else if filewritable(cwd.'/'.minfname) if ext == 'js' && executable('closure-compiler') cal system( 'closure-compiler --js '.cwd.'/'.nam.'.'.ext.' > '.cwd.'/'.minfname.' &') elseif executable('yuicompressor') cal system( 'yuicompressor '.cwd.'/'.nam.'.'.ext.' > '.cwd.'/'.minfname.' &') endif endif endif endfunction autocmd FileWritePost,BufWritePost *.js :call Js_css_compress() autocmd FileWritePost,BufWritePost *.css :call Js_css_compress() autocmd FileWritePost,BufWritePost *.less :call Js_css_compress() " GUI " taglist right side let Tlist_Use_Right_Window = 1 " hide tool bar set guioptions-=T "remove scroll bars set guioptions+=LlRrb set guioptions-=LlRrb " set the initial size of window set lines=46 columns=180 " set default font set guifont=Monospace " set guifont=Monospace\ 10 " show line number set number " set default theme colorscheme molokai-2 " encoding set encoding=utf-8 setglobal fileencoding=utf-8 bomb set fileencodings=ucs-bom,utf-8,latin1 " SCSS syntax highlight au BufRead,BufNewFile *.scss set filetype=scss " LESS syntax highlight syntax on au BufNewFile,BufRead *.less set filetype=less " Haml syntax highlight "au! BufRead,BufNewFile *.haml "setfiletype haml " Sass syntax highlight "au! BufRead,BufNewFile *.sass "setfiletype sass " set filetype indent filetype indent on " for snipMate to work filetype plugin on " show breaks set showbreak=-----> " coding format set tabstop=4 set shiftwidth=4 set linespace=1 " CONFIG " set location of ctags let Tlist_Ctags_Cmd='D:\ctags58\ctags.exe' " keep the buffer around when left set hidden " enable matchit plugin source $VIMRUNTIME/macros/matchit.vim " folding set foldmethod=marker set foldmarker={,} let g:FoldMethod = 0 map <leader>ff :call ToggleFold()<cr> fun! ToggleFold() if g:FoldMethod == 0 exe 'set foldmethod=indent' let g:FoldMethod = 1 else exe 'set foldmethod=marker' let g:FoldMethod = 0 endif endfun " save and restore folds when a file is closed and re-opened "au BufWrite ?* mkview "au BufRead ?* silent loadview " auto-open NERDTree everytime Vim is invoked au VimEnter * NERDTree /home/alex/www " set omnicomplete autocmd FileType python set omnifunc=pythoncomplete#Complete autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType html set omnifunc=htmlcomplete#CompleteTags autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType c set omnifunc=ccomplete#Complete " Remove trailing white-space once the file is saved au BufWritePre * silent g/\s\+$/s/// " Use CTRL-S for saving, also in Insert mode noremap <C-S> :update!<CR> vnoremap <C-S> <C-C>:update!<CR> inoremap <C-S> <C-O>:update!<CR> " DEFAULT set nocompatible source $VIMRUNTIME/vimrc_example.vim "source $VIMRUNTIME/mswin.vim "behave mswin " disable creation of swap files set noswapfile " no back ups wwhile editing set nowritebackup " disable creation of backups set nobackup " no file change pop up warning autocmd FileChangedShell * echohl WarningMsg | echo "File changed shell." | echohl None set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif let eq = '' if $VIMRUNTIME =~ ' ' if &sh =~ '\<cmd' let cmd = '""' . $VIMRUNTIME . '\diff"' let eq = '"' else let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' endif else let cmd = $VIMRUNTIME . '\diff' endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq endfunction

    Read the article

  • C/C++ Best indentation length?

    - by Tim
    I was reading a Vim tutorial ( http://www.oualline.com/vim-cook.html#drawing ), and came across this: This is very useful if you use a 4 space indentation for your C or C++ programs. (Studies at Rice University have shown this to be the best indentation size.) Is there any truth in these studies? Note-- i didn't mean for a flame war in indentation -- just whether anyone else has come across tis study before? EDIT: @MaR I made a poll http://poll.fm/3d5kg

    Read the article

  • Using Vim on the ipad... Any tips?

    - by pax1728
    I'm itching to program on my ipad. With the iSSH app I was able to log on to my university's server and even open an X server window. Unfortunately, the experience within iSSH is still rather clumsy. When using vim, the bottom line is hidden by the keyboard. Does anyone have any experience with SSH connections and the ipad or iphone? Are there better applications to use? I would prefer not to jailbreak my ipad.

    Read the article

  • vim default save is no file type? default setting advisable?

    - by Brady Trainor
    I just came across a problem that I seemed to have found a solution, but was a little surprised by the issue. In gVim, when I save a new document (new from "within" gVim), ala :w afile I realized it saves with I guess no file format, and thus is not visible in iPhone's PlainText app. Solution seems to be, save using :w afile.txt then the problem seems solved. Is this a good way to solve it? Should I change a default somewhere, either in Windows or _gvimrc file? I may consider doing some TeX'ing in vim at some point, so perhaps a default that allows for overriding in saving, and doesn't force txt when opening "any of all" documents.

    Read the article

  • how can I use vim as a wordprocess with soft wordwrap and columns only 40?

    - by Angela
    I have been trying to use vim as a wordprocessor to do most of my initial drafting and then open in abiword or open office to do my final printing. Problem has been, even with :set linebreak and :set wrap, when I open it, there's a ton of line breaks. I have to go and manually remove them. What I want is to be able to write at 40 columns wrap around softly so that when I open it up in Open Office, it gets restored to whatever that column width is, preserving things like carriage return but without all those linebreaks.

    Read the article

  • How to search for one of two similar strings in Vim?

    - by Nathan Long
    This is a pretty simple regex question, I think. In Vim, if I want do a search that matches planA or planB, I know that I can do this: /plan[AB] This works because the regex allows for either A or B as its set of characters. But how can I specify one of two complete strings? For example, to match both planetAwesome and planetTerrible, this doesn't work: planet[Awesome|Terrible] ... because it's looking for planetA or planetw or planete, etc. Nor does this: planet['Awesome'|'Terrible'] This will match both of these, along with planetAnythingHereAsLongAsItsJustLetters: planet\([a-zA-Z]*\) But how can I match only strings that match planetAwesome or planetTerrible exactly?

    Read the article

  • How do I change until the next underscore in VIm?

    - by Nathan Long
    If I have this text in vim, and my cursor is at the first character: www.foo.com I know that I can do: cw to change up to the first period, because a word (lowercase w) ends at any punctuation OR white space cW to change the whole address, because a Word (uppercase w) ends only at whitespace Now, what if I have this: stupid_method_name and want to change it to this? awesome_method_name Both cw and cW change the whole thing, but I just want to change the fragment before the underscore. My fallback technique is c/_, meaning 'change until you hit the next underscore in a search,' but for me, that also causes all underscores to be highlighted as search terms, which is slightly annoying. Is there a specifier like w or W that doesn't include underscores?

    Read the article

  • How Can I Close the Leftmost Window in Vim?

    - by msutherl
    I'm trying to write a command that will close a tree-browser (vim-tree) window and resize the other windows. ,to opens the window and adjusts the window size so that all open windows retain a normal size (using :set columns+=30CTRL-W =). ,tc should close the tree window (full-length, far left) and resize the main window (:set columns-=30). How can I write a command that closes the leftmost window so that I can type ,tc to close the window and resize in one shot? I can navigate to it with CTRL-W h, but it is inelegant and potentially annoying (audible bell!) to use 10CTRL-W h in the command. :topleft c unfortunately doesn't work. Can you think of an elegant way to do this?

    Read the article

  • VIM: How do you get the last ex command you used?

    - by TrevorBoydSmith
    I find that sometimes I write a really long ex mode command that do lots of stuff. They are sort of "mini-scripts" that I write in the text editor then I start ex mode and copy them into the ex line and execute. But then I always end up editing in the ex mode and then I find it difficult to get the changes i did in ex mode back to my text editing session. Using the keyboard, how do you copy the last ex command you used and paste it into your text editor? (Note: This is sort of the opposite of this question "how do I copy/paste in vim ex mode" where the user asks "how do you copy from the text editor and paste INTO the ex mode?". My question is the opposite because I wish to copy from the ex mode and paste into my text editor.)

    Read the article

  • How to make VIM settings computer-dependent in .vimrc?

    - by Paperflyer
    I share my VIM configuration file between several computers. However, I want some settings to be specific for certain computers. For example, font sizes on the high-res laptop should be different to the low-res desktop. And more importantly, I want gVIM on Windows to behave more windowsy and MacVim on OSX to behave more maccy and gVIM on Linux to just behave like it always does. (That might be a strange sentiment, but I am very used to switch mental modes when switching OSes) Is there a way to make a few settings in the .vimrc machine- or OS-dependent?

    Read the article

  • How to map command in vim that maintains mode when invoked?

    - by Phoenix
    I'm configuring vim in Mac OS X's Terminal app to do useful things with my arrow keys (among others). For example, I want option-left to move the cursor back one word, similarly to how it works in other Mac applications. In normal mode, this is easy enough; I can simply map the sequence to b. But when I'm in insert mode, I want to stay in insert mode (i.e., map the sequence to <c-o>b. In my .vimrc` file, I have these lines: nmap ^[[xol~ b imap ^[[xol~ <c-o>b Where ^[[xol~ is the character sequence that I've configured Terminal to send when I press option-left. This works, but it gets pretty tedious, especially when I've got nearly two dozen commands that I want to map. Is there a better way to do this?

    Read the article

  • With VIM, use both snipMate and pydiction together (share the <tab> key?)

    - by thornomad
    I am trying to use snipMate and pydiction in vim together - however, both use the <tab> key to perform their genius-auto-completion-snippet-rendering-goodness-that-I-so-desire. When pydiction is installed, snipMate stops working. I assume its because they can't both own the <tab> key. How can I get them to work together? I wouldn't mind mapping one of them to a different key, but I am not really sure how to do this ... (maybe pydiction to the <ctrl-n> key so it mimics vim's autocomplete?). Here is the relevant .vimrc: filetype indent plugin on autocmd FileType python set ft=python.django autocmd FileType html set ft=html.django_template let g:pydiction_location = '~/.vim/ftplugin/pydiction-1.2/complete-dict'

    Read the article

  • What is the best way to write faster on Vim using a non-english keyboard?

    - by Martín Fixman
    I usually use Vim, and its great for the ability to do faster some actions than other editors. However, since I live in Argentina I have a Latin American keyboard, that makes everything in Vim pretty slower (to write / to search, I must press Shift+7). Since I don't want to be changing Keyboard layouts all the time (and its pretty difficult to get used to pressing symbols as in an English keyboard), I was wondering if there was a vim plugin (of .vimrc file) that may be useful for international users. Just for the sake of it, here's how the Latin American keyboard is laid out: By the way, I would love to go and buy an English keyboard, but unfortunately I use a Laptop.

    Read the article

  • Vi/Vim: How to pipe visually selected text to a UNIX command and append output to current file

    - by drsnyder
    Using Vim, I'm trying to pipe visually selected text to a UNIX command and have the output appended to the end of the current file. For example, say we have a SQL command such as: SELECT * FROM mytable; I want to do something like the following: V # select text :'<,'!mysql -uuser -ppass mydb But instead of having the output overwrite the currently selected text, I would like to have the output appended to the end of the file. You probably see where this is going. I'm working on using VIM as a simple SQL editor. That way, I don't have to leave VIM to edit, tweak, test SQL code. Thanks!

    Read the article

  • is vim able to detect in which language a file is written, and then load the correct dictionnary ?

    - by Niels
    I am using several languages, and by now I am obliged to indicate vim with which of these the spell check must be done. Is there a way to set up vim so that he automatically detects the correct one ? I remember vaguely that in a previous version of vim, when the spell check was not integrated, this was possible, using the vimspell script. It would be even better if this could apply not only to a file but also to a portion of a file, since I frequently mix several languages in a single file. Of course, I would like to avoid to load several dictionaries simultaneously.

    Read the article

  • Are there Vi/Vim users who aren't touch typists?

    - by michael
    I'm trying to write a Vim tutorial and I'd like to start by dismissing a few misconceptions, as well as giving some recommendations. I don't know if I should dismiss touch-typing as a misconception, or include it as a recommended prerequisite. At the time I learned the editor, I had already been touch typing for a couple of years, so I have absolutely no idea what would be the experience of a two-fingered typist in Vim. Are you a vim two-fingered typist? what has your experience been like?

    Read the article

  • Is vim able to detect the natural language of a file, then load the correct dictionary ?

    - by Niels
    I am using several languages, and currently I am obliged to indicate to vim with which of these the spell check must be done. Is there a way to set up vim so that it automatically detects the correct one? I vaguely remember that in a previous version of vim, when the spell check was not integrated, the vimspell script made this possible. It would be even better if this could apply not only to a file but also to a portion of a file, since I frequently mix several languages in a single file. Of course, I would like to avoid to load several dictionaries simultaneously.

    Read the article

  • How do you use VIM to edit tabular data (tables)? Specifically, BIND (named) DNS db files.

    - by Richard Bronosky
    I'm usually a purist when it comes to vimming. I don't like remapping keys, or learning to rely on a bunch of plugins. I like to feel just as powerful on foreign boxen as I do on my own dev box. I do, however, believe in syntax files. Even though the solution may not be a syntax file (bindzone.vim is what I use), I want it bad enough to do whatever. I regularly view or edit tab (or comma, but that would be a bonus) delimited data. I hate having to set my tabstop to some ridiculous number in order to have everything line up. Example: The BIND zone files are ~40+,6,2,5,15+. So, even though I could view them on a single screen, if I set ts=40, I cannot. I have been searching for a "dynamic tab size" solution for years, but no luck. I hate that my only good way of editing or even visualizing tabular data is to scp it to my work station and open it in Open Office. There has to be a better way.

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >