vim/vimrc_example1
Martin Schreiner e023928171 - Introduce patch to fix bsc#1235751 (regression).
* vim-9.1.1134-revert-putty-terminal-colors.patch
- Update to 9.1.1176.
  * 9.1.1176: wrong indent when expanding multiple lines
              test(runtime/syntax): improve syntax tests
              editorconfig: set indent config for *.vim files
              runtime(doc): mention alternative check for vim9script
  * 9.1.1175: inconsistent behaviour with exclusive selection and motion commands
              runtime(man): don't add jumps when loading a manpage
              runtime(vim): recognize <...> strings (and keys) for 'keywordprg'
  * 9.1.1174: tests: Test_complete_cmdline() may fail
              runtime(doc): mention bzip3 in gzip plugin documentation
  * 9.1.1173: filetype: ABNF files are not detected
  * 9.1.1172: [security]: overflow with 'nostartofline' and Ex command in tag file
  * 9.1.1171: tests: wrong arguments passed to assert_equal()
  * 9.1.1170: wildmenu highlighting in popup can be improved
              runtime(netrw): upstream snapshot of v179
              runtime(doc): fix typo "bet" in :h 'completeopt'
  * 9.1.1169: using global variable for get_insert()/get_lambda_name()
  * 9.1.1168: wrong flags passed down to nextwild()
  * 9.1.1167: mark '] wrong after copying text object
              runtime(doc): update how to get Vim
  * 9.1.1166: command-line auto-completion hard with wildmenu
              runtime(tar): use readblob() instead of shelling out to file(1)
  * 9.1.1165: diff: regression with multi-file diff blocks
  * 9.1.1164: [security]: code execution with tar.vim and special crafted tar files
              translation(it): Update Italian translation
              runtime(tar): fix syntax error in tar.vim
  * 9.1.1163: $MYVIMDIR is set too late
              runtime(syntax-tests): Apply stronger synchronisation between buffers

OBS-URL: https://build.opensuse.org/package/show/editors/vim?expand=0&rev=879
2025-03-07 02:01:07 +00:00

162 lines
5.1 KiB
Plaintext

" Vim
" An example for a vimrc file.
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
set nocompatible " Use Vim defaults (much better!)
set bs=2 " allow backspacing over everything in insert mode
set ai " always set autoindenting on
set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
:set showmatch " jump emacs style to matching bracket
"these characters can move past end of line
:set whichwrap=b,s,h,l
"default tabs are too wide IMO. uncomment to change them
" :set tabstop=6
" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=78
" 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
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
augroup cprog
" Remove all cprog autocommands
au!
" When starting to edit a file:
" For *.c and *.h files set formatting of comments and set C-indenting on.
" For other files switch it off.
" Don't change the order, it's important that the line with * comes first.
autocmd BufRead * set formatoptions=tcql nocindent comments&
autocmd BufRead *.c,*.h set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,://
augroup END
augroup gzip
" Remove all gzip autocommands
au!
" Enable editing of gzipped files
" read: set binary mode before reading the file
" uncompress text in buffer after reading
" write: compress file after writing
" append: uncompress file, append, compress file
autocmd BufReadPre,FileReadPre *.gz set bin
autocmd BufReadPost,FileReadPost *.gz let ch_save = &ch|set ch=2
autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip
autocmd BufReadPost,FileReadPost *.gz set nobin
autocmd BufReadPost,FileReadPost *.gz let &ch = ch_save|unlet ch_save
autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r")
autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
autocmd FileAppendPre *.gz !gunzip <afile>
autocmd FileAppendPre *.gz !mv <afile>:r <afile>
autocmd FileAppendPost *.gz !mv <afile> <afile>:r
autocmd FileAppendPost *.gz !gzip <afile>:r
augroup END
"let bash_is_sh = 1
"let is_bash = 1
" Uncomment to turn off arrow keys. Using arrow keys is a good habit to
" get out of ...
":map <left> <Nop>
":map <right> <Nop>
":map <up> <Nop>
":map <down> <Nop>
":imap <left> <Nop>
":imap <right> <Nop>
":imap <up> <Nop>
":imap <down> <Nop>
" Some emacs/pico like keybindings for insert mode
":imap <C-A> <ESC>0i
":imap <C-E> <ESC>$a
":imap <C-P> <ESC>ki
":imap <C-N> <ESC>ji
":imap <C-B> <ESC>la
":imap <C-F> <ESC>ha
" Some highlighting definitions
" THis is the default.
" Doesn't use colours wisely IMO. Consider changing Repeat and Conditional
" to make them stand out a little better.
" There are two sets of defaults: for a dark and a light background.
if &background == "dark"
hi Comment term=bold ctermfg=Cyan guifg=#80a0ff
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0
hi Special term=bold ctermfg=LightRed guifg=Orange
hi Identifier term=underline cterm=bold ctermfg=Cyan guifg=#40ffff
hi Statement term=bold ctermfg=Yellow guifg=#ffff60 gui=bold
hi PreProc term=underline ctermfg=LightBlue guifg=#ff80ff
hi Type term=underline ctermfg=LightGreen guifg=#60ff60 gui=bold
hi Ignore ctermfg=black guifg=bg
else
hi Comment term=bold ctermfg=DarkBlue guifg=Blue
hi Constant term=underline ctermfg=DarkRed guifg=Magenta
hi Special term=bold ctermfg=DarkMagenta guifg=SlateBlue
hi Identifier term=underline ctermfg=DarkCyan guifg=DarkCyan
hi Statement term=bold ctermfg=Brown gui=bold guifg=Brown
hi PreProc term=underline ctermfg=DarkMagenta guifg=Purple
hi Type term=underline ctermfg=DarkGreen guifg=SeaGreen gui=bold
hi Ignore ctermfg=white guifg=bg
endif
hi Error term=reverse ctermbg=Red ctermfg=White guibg=Red guifg=White
hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Blue guibg=Yellow
" Common groups that link to default highlighting.
" You can specify other highlighting easily.
hi link String Constant
hi link Character Constant
hi link Number Constant
hi link Boolean Constant
hi link Float Number
hi link Function Identifier
hi link Conditional Statement
hi link Repeat Statement
hi link Label Statement
hi link Operator Statement
hi link Keyword Statement
hi link Exception Statement
hi link Include PreProc
hi link Define PreProc
hi link Macro PreProc
hi link PreCondit PreProc
hi link StorageClass Type
hi link Structure Type
hi link Typedef Type
hi link Tag Special
hi link SpecialChar Special
hi link Delimiter Special
hi link SpecialComment Special
hi link Debug Special