Saltstack Official Users Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

168 lines
5.7KB

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