code_junkie

vim Comment Newlines Unexpected Behavior

Nov 13th, 2011
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. //hello world my name is stefan
  2.  
  3. //hello
  4. //world
  5. //my
  6. //name
  7. //is
  8. //stefan
  9.  
  10. print "Hello world my name is Stefan"
  11.  
  12. print
  13. "hello
  14. world
  15. my
  16. name
  17. is
  18. stefan"
  19.  
  20. " An example for a vimrc file.
  21. "
  22. " Maintainer: Bram Moolenaar <email address>
  23. " Last change: 2006 Nov 16
  24. "
  25. " To use it, copy it to
  26. " for Unix and OS/2: ~/.vimrc
  27. " for Amiga: s:.vimrc
  28. " for MS-DOS and Win32: $VIM_vimrc
  29. " for OpenVMS: sys$login:.vimrc
  30.  
  31. " When started as "evim", evim.vim will already have done these settings.
  32. if v:progname =~? "evim"
  33. finish
  34. endif
  35.  
  36. " TagList plugin settings
  37. nmap <f12> :TlistToggle<end>
  38.  
  39. " Use Vim settings, rather then Vi settings (much better!).
  40. " This must be first, because it changes other options as a side effect.
  41. set nocompatible
  42.  
  43. " allow backspacing over everything in insert mode
  44. set backspace=indent,eol,start
  45.  
  46. set nobackup " do not keep a backup file, use versions instead
  47. set history=50 " keep 50 lines of command line history
  48. set ruler " show the cursor position all the time
  49. set showcmd " display incomplete commands
  50. set incsearch " do incremental searching
  51.  
  52. " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
  53. " let &guioptions = substitute(&guioptions, "t", "", "g")
  54.  
  55. " Don't use Ex mode, use Q for formatting
  56. map Q gq
  57.  
  58. " In many terminal emulators the mouse works just fine, thus enable it.
  59. " set mouse=a
  60.  
  61. " Switch syntax highlighting on, when the terminal has colors
  62. " Also switch on highlighting the last used search pattern.
  63. if &t_Co > 2 || has("gui_running")
  64. syntax on
  65. set hlsearch
  66. endif
  67.  
  68. " Only do this part when compiled with support for autocommands.
  69. if has("autocmd")
  70.  
  71. " Enable file type detection.
  72. " Use the default filetype settings, so that mail gets 'tw' set to 72,
  73. " 'cindent' is on in C files, etc.
  74. " Also load indent files, to automatically do language-dependent indenting.
  75. filetype plugin indent on
  76.  
  77. " Put these in an autocmd group, so that we can delete them easily.
  78. augroup vimrcEx
  79. au!
  80.  
  81. " For all text files set 'textwidth' to 78 characters.
  82. autocmd FileType text setlocal textwidth=78
  83.  
  84. " When editing a file, always jump to the last known cursor position.
  85. " Don't do it when the position is invalid or when inside an event handler
  86. " (happens when dropping a file on gvim).
  87. autocmd BufReadPost *
  88. if line("'"") > 0 && line("'"") <= line("$") |
  89. exe "normal! g`"" |
  90. endif
  91.  
  92. augroup END
  93.  
  94. else
  95.  
  96. set autoindent " always set autoindenting on
  97.  
  98. endif " has("autocmd")
  99.  
  100. set backupdir=./.backup,.,/tmp
  101. set directory=.,./.backup,/tmp
  102.  
  103. map <F1> :NERDTree <CR>
  104. map <F2> :q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>:q!<CR>
  105. map <F5> :AV<CR>
  106. map <F6> :AS<CR>
  107. map <F7> :IHV<CR>
  108. map <F8> :IHS<CR>
Add Comment
Please, Sign In to add comment