Saltstack Official Users Formula
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

161 líneas
5.4KB

  1. " URL: http://vim.wikia.com/wiki/Example_vimrc
  2. " Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
  3. " Description: A minimal, but feature rich, example .vimrc. If you are a
  4. " newbie, basing your first .vimrc on this file is a good choice.
  5. " If you're a more advanced user, building your own .vimrc based
  6. " on this file is still a good idea.
  7. "------------------------------------------------------------
  8. " Features {{{1
  9. "
  10. " These options and commands enable some very useful features in Vim, that
  11. " no user should have to live without.
  12. " Set 'nocompatible' to ward off unexpected things that your distro might
  13. " have made, as well as sanely reset options when re-sourcing .vimrc
  14. set nocompatible
  15. " Attempt to determine the type of a file based on its name and possibly its
  16. " contents. Use this to allow intelligent auto-indenting for each filetype,
  17. " and for plugins that are filetype specific.
  18. filetype indent plugin on
  19. " Enable syntax highlighting
  20. syntax on
  21. "------------------------------------------------------------
  22. " Must have options {{{1
  23. "
  24. " These are highly recommended options.
  25. " Vim with default settings does not allow easy switching between multiple files
  26. " in the same editor window. Users can use multiple split windows or multiple
  27. " tab pages to edit multiple files, but it is still best to enable an option to
  28. " allow easier switching between files.
  29. "
  30. " One such option is the 'hidden' option, which allows you to re-use the same
  31. " window and switch from an unsaved buffer without saving it first. Also allows
  32. " you to keep an undo history for multiple files when re-using the same window
  33. " in this way. Note that using persistent undo also lets you undo in multiple
  34. " files even in the same window, but is less efficient and is actually designed
  35. " for keeping undo history after closing Vim entirely. Vim will complain if you
  36. " try to quit without saving, and swap files will keep you safe if your computer
  37. " crashes.
  38. set hidden
  39. " Note that not everyone likes working this way (with the hidden option).
  40. " Alternatives include using tabs or split windows instead of re-using the same
  41. " window as mentioned above, and/or either of the following options:
  42. " set confirm
  43. " set autowriteall
  44. " Better command-line completion
  45. set wildmenu
  46. " Show partial commands in the last line of the screen
  47. set showcmd
  48. " Highlight searches (use <C-L> to temporarily turn off highlighting; see the
  49. " mapping of <C-L> below)
  50. set hlsearch
  51. " Modelines have historically been a source of security vulnerabilities. As
  52. " such, it may be a good idea to disable them and use the securemodelines
  53. " script, <http://www.vim.org/scripts/script.php?script_id=1876>.
  54. " set nomodeline
  55. "------------------------------------------------------------
  56. " Usability options {{{1
  57. "
  58. " These are options that users frequently set in their .vimrc. Some of them
  59. " change Vim's behaviour in ways which deviate from the true Vi way, but
  60. " which are considered to add usability. Which, if any, of these options to
  61. " use is very much a personal preference, but they are harmless.
  62. " Use case insensitive search, except when using capital letters
  63. set ignorecase
  64. set smartcase
  65. " Allow backspacing over autoindent, line breaks and start of insert action
  66. set backspace=indent,eol,start
  67. " When opening a new line and no filetype-specific indenting is enabled, keep
  68. " the same indent as the line you're currently on. Useful for READMEs, etc.
  69. set autoindent
  70. " Stop certain movements from always going to the first character of a line.
  71. " While this behaviour deviates from that of Vi, it does what most users
  72. " coming from other editors would expect.
  73. set nostartofline
  74. " Display the cursor position on the last line of the screen or in the status
  75. " line of a window
  76. set ruler
  77. " Always display the status line, even if only one window is displayed
  78. set laststatus=2
  79. " Instead of failing a command because of unsaved changes, instead raise a
  80. " dialogue asking if you wish to save changed files.
  81. set confirm
  82. " Use visual bell instead of beeping when doing something wrong
  83. set visualbell
  84. " And reset the terminal code for the visual bell. If visualbell is set, and
  85. " this line is also included, vim will neither flash nor beep. If visualbell
  86. " is unset, this does nothing.
  87. set t_vb=
  88. " Enable use of the mouse for all modes
  89. set mouse=a
  90. " Set the command window height to 2 lines, to avoid many cases of having to
  91. " "press <Enter> to continue"
  92. set cmdheight=2
  93. " Display line numbers on the left
  94. set number
  95. " Quickly time out on keycodes, but never time out on mappings
  96. set notimeout ttimeout ttimeoutlen=200
  97. " Use <F11> to toggle between 'paste' and 'nopaste'
  98. set pastetoggle=<F11>
  99. "------------------------------------------------------------
  100. " Indentation options {{{1
  101. "
  102. " Indentation settings according to personal preference.
  103. " Indentation settings for using 4 spaces instead of tabs.
  104. " Do not change 'tabstop' from its default value of 8 with this setup.
  105. set shiftwidth=4
  106. set softtabstop=4
  107. set expandtab
  108. " Indentation settings for using hard tabs for indent. Display tabs as
  109. " four characters wide.
  110. "set shiftwidth=4
  111. "set tabstop=4
  112. "------------------------------------------------------------
  113. " Mappings {{{1
  114. "
  115. " Useful mappings
  116. " Map Y to act like D and C, i.e. to yank until EOL, rather than act as yy,
  117. " which is the default
  118. map Y y$
  119. " Map <C-L> (redraw screen) to also turn off search highlighting until the
  120. " next search
  121. nnoremap <C-L> :nohl<CR><C-L>
  122. "------------------------------------------------------------