Vim Folding

2010.12.05 17:02

Edit vimrc
># vim ~/.vimrc
 "Folding Settings
set foldmethod=indent
set foldnestmax=1-
set foldevel=1

Shortcuts
za  - toggle folding
zM - fold everything
zm - fold selected block
zR  - unfold everything
zr   - unfold selected block

help :folding

References
저작자 표시
신고

'linux > vim' 카테고리의 다른 글

Vim Folding  (1) 2010.12.05
Tag List on the side Windows in Vim.  (0) 2010.12.03
Indenting XML in vi editor  (0) 2010.04.01
How to map keys in vim  (1) 2010.01.18
Vim Tips  (0) 2010.01.06
To Comment/Un-Comment single/multiple lines of code for different source file  (0) 2009.12.16

Frank kenshin579 linux/vim Folding, VIM

  1. If you are planning to take one flight or several flights in the near future, hear are a few things I suggest to keep your pocketbook from going on an unnecessary diet, http://www.moncleroutletespain.com/ moncler españa. First of all, pack a good book and skip the in flight movie, http://www.moncleroutletespain.com/ moncler. If you are traveling with children, bring handheld games, http://www.moncleroutletespain.com/ http://www.moncleroutletespain.com/, crayons, coloring books, and snacks. Even if you aren, http://www.moncleroutletespain.com/ moncler online?t traveling with children it is much wiser to bring your own food and drink onto the plane rather than paying the premium prices that the airlines are charging. Wear comfortable clothing and bring a light jacket onboard with you if you get cold on flights.These things are small things you can do to make your flights more comfortable and enjoyable, http://www.moncleroutletespain.com/ moncler outlet. For many of us our flights are the beginning of our vacations, http://www.moncleroutletespain.com/ moncler chaquetas. It is much better to get off to a stress free beginning than arrive at your vacation destination frazzled, stressed out, and much poorer than when you began the process.Related articles:


    http://jjeong.tistory.com/594 http://jjeong.tistory.com/594

    http://antiares.tistory.com/22 http://antiares.tistory.com/22

Tag List on the side Windows in Vim.

2010.12.03 16:25
Requires exuberant ctags
.
># sudo apt-get install exuberant-ctags

Unzip the taglist_45.zip and copy the following files to $HOME/.vim/ directory where it is appropriated
plugin/taglist.vim - main taglist plugin file
doc/taglist.txt    - documentation (help) file

Restart your vim editor and type the following command to open the side window. 

:TlistToggle



To customize the side windows, please take a look at the following.
 " TagList options
let Tlist_Close_On_Select = 1 "close taglist window once we selected something
let Tlist_Exit_OnlyWindow = 1 "if taglist window is the only window left, exit vim
let Tlist_Show_Menu = 1 "show Tags menu in gvim
let Tlist_Show_One_File = 1 "show tags of only one file
let Tlist_GainFocus_On_ToggleOpen = 1 "automatically switch to taglist window
let Tlist_Highlight_Tag_On_BufEnter = 1 "highlight current tag in taglist window
let Tlist_Process_File_Always = 1 "even without taglist window, create tags file, required for displaying tag in statusline
let Tlist_Use_Right_Window = 1 "display taglist window on the right
let Tlist_Display_Prototype = 1 "display full prototype instead of just function name
"let Tlist_Ctags_Cmd = /path/to/exuberant/ctags

nnoremap <F5> :TlistToggle
nnoremap <F6> :TlistShowPrototype

set statusline=[%n]\ %<%f\ %([%1*%M%*%R%Y]%)\ \ \ [%{Tlist_Get_Tagname_By_Line()}]\ %=%-19(\LINE\ [%l/%L]\ COL\ [%02c%03V]%)\ %P


저작자 표시
신고

'linux > vim' 카테고리의 다른 글

Vim Folding  (1) 2010.12.05
Tag List on the side Windows in Vim.  (0) 2010.12.03
Indenting XML in vi editor  (0) 2010.04.01
How to map keys in vim  (1) 2010.01.18
Vim Tips  (0) 2010.01.06
To Comment/Un-Comment single/multiple lines of code for different source file  (0) 2009.12.16

Frank kenshin579 linux/vim taglist, VIM

Indenting XML in vi editor

2010.04.01 17:46
For the moment, I'm not sure how to automatically indent a xml file within vi editor.

This is temporary solution.

:set filetype=xml
:filetype indent on
gg=G
저작자 표시
신고

'linux > vim' 카테고리의 다른 글

Vim Folding  (1) 2010.12.05
Tag List on the side Windows in Vim.  (0) 2010.12.03
Indenting XML in vi editor  (0) 2010.04.01
How to map keys in vim  (1) 2010.01.18
Vim Tips  (0) 2010.01.06
To Comment/Un-Comment single/multiple lines of code for different source file  (0) 2009.12.16

Frank kenshin579 linux/vim indent, Vi Editor, XML

How to map keys in vim

2010.01.18 01:26
I want to map <Ctrl + S> as Save command in Vim.
Becuase <Ctrl+s> stops the output in the terminal, it's important to change the shortcut first using stty command.



># stty stop ^K



In the terminal, <Ctrl+S> command is stop printing inputs

># vim .vimrc
map <C-S> :w<CR>                 'command mode
map! <C-S> <Esc>:w<CR>       'insert mode

References
1. How to map keys in vim, http://how-to.wikia.com/wiki/How_to_map_keys_in_vim
2. Mapping keys in Vim - Tutorial, http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_%28Part_1%29
3. Mapping Keys, http://newbiedoc.sourceforge.net/tutorials/vim/mapping-vim.html.en
저작자 표시
신고

'linux > vim' 카테고리의 다른 글

Tag List on the side Windows in Vim.  (0) 2010.12.03
Indenting XML in vi editor  (0) 2010.04.01
How to map keys in vim  (1) 2010.01.18
Vim Tips  (0) 2010.01.06
To Comment/Un-Comment single/multiple lines of code for different source file  (0) 2009.12.16
Switch to next/previous file in VIM  (0) 2009.11.07

Frank kenshin579 linux/vim mapping keys, VI

  1. 이것좀 퍼갈께요 ~~ 와 유용하네요^^

Vim Tips

2010.01.06 19:32
1. Change the color setting for comments and add the statusline

colorscheme desert
"or
highlight comment ctermfg=green guifg=green
highlight Type          ctermfg=DarkMagenta
highlight Comment       ctermfg=DarkGreen
set laststatus=2
set ruler



2. Bookmark
ma : mark current location to 'a'
'a : move to bookmark 'a'

3. Copy a word and paste it over  other words
yiw : yank inner word and move the cursor to another word
viwp : select the current word and replace it with the yanked word

* Windows related shortcuts
Ctrl + W,V : opens up duplicate windows
Ctrl + W,= : evenly arrange the current windows

* Editing
Selected text + = : auto indentation
db: Delete word in backward

Misc Shortcuts
:reg : to see what in the register (copy-board buffer)
저작자 표시
신고

'linux > vim' 카테고리의 다른 글

Indenting XML in vi editor  (0) 2010.04.01
How to map keys in vim  (1) 2010.01.18
Vim Tips  (0) 2010.01.06
To Comment/Un-Comment single/multiple lines of code for different source file  (0) 2009.12.16
Switch to next/previous file in VIM  (0) 2009.11.07
Add line numbers in vim  (0) 2009.11.02

Frank kenshin579 linux/vim bookmark, change colorscheme, Introduction, VIM

To Comment/Un-Comment single/multiple lines of code for different source file

2009.12.16 11:48

># wget http://www.vim.org/scripts/download_script.php?src_id=9801
># mkdir -p ~.vim/plugin

># vim hello.c

Shortcut
ctrl + c = Comment line(s)
ctrl + x = Uncomment line(s)

NOTE: I modified the the plugin file to work with CUDA source files as well.



References
1. http://www.vim.org/scripts/script.php?script_id=1528
저작자 표시
신고

Frank kenshin579 linux/vim comment/uncomment plugins, VIM

Switch to next/previous file in VIM

2009.11.07 17:50
Within the vim editor, how can we switch to next/previous files.

$ vim */syslog
To move to next file
:n

To move to previous file
:prev
저작자 표시
신고

'linux > vim' 카테고리의 다른 글

Vim Tips  (0) 2010.01.06
To Comment/Un-Comment single/multiple lines of code for different source file  (0) 2009.12.16
Switch to next/previous file in VIM  (0) 2009.11.07
Add line numbers in vim  (0) 2009.11.02
Enable Syntax Highlight for CUDA file extension in VIM  (1) 2009.10.28
.vimrc sample  (0) 2009.09.22

Frank kenshin579 linux/vim

Add line numbers in vim

2009.11.02 20:40
Instead of just displaying numbers (:set nu) in vim, I want to add lines numbers to a file in vim

:%s/^/\=line('.')/

    ===>>> 



Reference
1. http://stackoverflow.com/questions/252766/add-line-numbers-in-vim

저작자 표시
신고

'linux > vim' 카테고리의 다른 글

Vim Tips  (0) 2010.01.06
To Comment/Un-Comment single/multiple lines of code for different source file  (0) 2009.12.16
Switch to next/previous file in VIM  (0) 2009.11.07
Add line numbers in vim  (0) 2009.11.02
Enable Syntax Highlight for CUDA file extension in VIM  (1) 2009.10.28
.vimrc sample  (0) 2009.09.22

Frank kenshin579 linux/vim

Enable Syntax Highlight for CUDA file extension in VIM

2009.10.28 22:15
==>>

># vim ~/.vimrc
syntax on
filetype on
au BufNewFile,BufRead *.cu set filetype=c

저작자 표시
신고

'linux > vim' 카테고리의 다른 글

Vim Tips  (0) 2010.01.06
To Comment/Un-Comment single/multiple lines of code for different source file  (0) 2009.12.16
Switch to next/previous file in VIM  (0) 2009.11.07
Add line numbers in vim  (0) 2009.11.02
Enable Syntax Highlight for CUDA file extension in VIM  (1) 2009.10.28
.vimrc sample  (0) 2009.09.22

Frank kenshin579 linux/vim

  1. Une conseillère municipale de Lorgues (Var) reconnue coupable de "menaces de mort" et de "dénonciation calomnieuse" après avoir écrit deux lettres à connotations homophobes à un artiste peintre homosexuel a été condamnée jeudi à 6 mois de prison avec sursis par le tribunal correctionnel de Draguignan, http://www.timberlandbaratas.com timberland españa.Related articles:


    http://unsoundsociety.tistory.com/461 Les négociations nucléaires entre l'Iran et les pays du groupe 5+1 (Etats-Unis

    http://www.theuntoday.com/category/?page=33 Le gouverneur démocrate Jerry Brown a pris officiellement les rênes de la Californie des mains d'A

.vimrc sample

2009.09.22 19:54
" An example for a vimrc file.
"
" Maintainer:    Bram Moolenaar <Bram@vim.org>
" Last change:    2002 May 28
"
" To use it, copy it to
"     for Unix and OS/2:  ~/.vimrc
"          for Amiga:  s:.vimrc
"  for MS-DOS and Win32:  $VIM\_vimrc
"        for OpenVMS:  sys$login:.vimrc

" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
  finish
endif

" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible

" allow backspacing over everything in insert mode
set backspace=indent,eol,start

set autoindent        " always set autoindenting on
set cindent        " always set autoindenting on
set nobackup        " do not keep a backup file, use versions instead
set history=50        " keep 50 lines of command line history
set ruler        " show the cursor position all the time
set showcmd        " display incomplete commands
set incsearch        " do incremental searching

set nonu
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set bg=dark
set showmatch

" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")

" Don't use Ex mode, use Q for formatting
map Q gq

" This is an alternative that also works in block mode, but the deleted
" text is lost and it only works for putting the current register.
"vnoremap p "_dp

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
syntax on
set hlsearch

" Only do this part when compiled with support for autocommands.
if has("autocmd")

  " Enable file type detection.
  " Use the default filetype settings, so that mail gets 'tw' set to 72,
  " 'cindent' is on in C files, etc.
  " Also load indent files, to automatically do language-dependent indenting.
  filetype plugin indent on

  " For all text files set 'textwidth' to 78 characters.
  autocmd FileType text setlocal textwidth=78

  " When editing a file, always jump to the last known cursor position.
  " Don't do it when the position is invalid or when inside an event handler
  " (happens when dropping a file on gvim).
  autocmd BufReadPost *
    \ if line("'\"") > 0 && line("'\"") <= line("$") |
    \   exe "normal g`\"" |
    \ endif

endif " has("autocmd")

" tex related maps
" pdflatex command
map! \' :w
:!pdflatex -interaction=nonstopmode %
 :!bibtex %:r
 :!pdflatex -interaction=nonstopmode %
map \' :w
:!pdflatex -interaction=nonstopmode %
 :!bibtex %:r
 :!pdflatex -interaction=nonstopmode %
" view pdf
map \" :!okular %:r.pdf&

set fileencodings=utf-8,euc-kr

set foldmethod=syntax
highlight Folded ctermfg=red
highlight FoldColumn ctermfg=white

저작자 표시
신고

'linux > vim' 카테고리의 다른 글

Vim Tips  (0) 2010.01.06
To Comment/Un-Comment single/multiple lines of code for different source file  (0) 2009.12.16
Switch to next/previous file in VIM  (0) 2009.11.07
Add line numbers in vim  (0) 2009.11.02
Enable Syntax Highlight for CUDA file extension in VIM  (1) 2009.10.28
.vimrc sample  (0) 2009.09.22

Frank kenshin579 linux/vim .vimrc vim