From fe89b5671d65560b57d51485789c23c38885e28d Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Tue, 24 May 2016 14:14:54 +0200 Subject: major update: plugins, colorscheme, shortcuts, new git submodule! * using nelstroms mac color scheme * 'fixed' some keyboard shortcuts to behave more like in other editors * added some plugins --- .gitmodules | 6 +- colors/mac_classic.vim | 1 + colors/nelstrom | 1 + doc/list-of-filetypes.txt | 175 ++++++++++++++++++++++++++++++++++++++++++++++ doc/shortcuts.txt | 64 ++++++++++------- vimrc | 81 +++++++++++++++++---- 6 files changed, 283 insertions(+), 45 deletions(-) create mode 120000 colors/mac_classic.vim create mode 160000 colors/nelstrom create mode 100644 doc/list-of-filetypes.txt diff --git a/.gitmodules b/.gitmodules index cdf3d7a..8e27078 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ -[submodule "plugins/Vundle.vim"] - path = plugins/Vundle.vim - url = https://github.com/VundleVim/Vundle.vim.git [submodule "bundle/Vundle.vim"] path = bundle/Vundle.vim url = https://github.com/VundleVim/Vundle.vim.git +[submodule "colors/nelstrom"] + path = colors/nelstrom + url = https://github.com/nelstrom/vim-mac-classic-theme.git diff --git a/colors/mac_classic.vim b/colors/mac_classic.vim new file mode 120000 index 0000000..c1f3dc2 --- /dev/null +++ b/colors/mac_classic.vim @@ -0,0 +1 @@ +nelstrom/colors/mac_classic.vim \ No newline at end of file diff --git a/colors/nelstrom b/colors/nelstrom new file mode 160000 index 0000000..8bf9e3d --- /dev/null +++ b/colors/nelstrom @@ -0,0 +1 @@ +Subproject commit 8bf9e3d96a0988849e8dd9954d443857191c8639 diff --git a/doc/list-of-filetypes.txt b/doc/list-of-filetypes.txt new file mode 100644 index 0000000..9752c6a --- /dev/null +++ b/doc/list-of-filetypes.txt @@ -0,0 +1,175 @@ +# this list can be generated with ':setfiletype '. I have copied it to +# make it searchable. + +2html erlang master sinda +HGAnnotate eruby matlab sindacmp +PKGBUILD esmtprc maxima sindaout +a2ps esqlc mel sisu +a65 esterel messages skill +aap eterm mf sl +abap euphoria3 mgl slang +abaqus euphoria4 mgp slice +abc eviews mib slim +abel exim mix slpconf +acedb expect mma slpreg +ada exports mmix slpspi +aflex falcon mmp slrnrc +ahdl fan modconf slrnsc +alsaconf fasm model sm +amiga fdcc modsim3 smarty +aml fetchmail modula2 smcl +ampl fgl modula3 smil +ansible fish monk smith +ansible_hosts flexwiki moo sml +ansible_template focexec mp snnsnet +ant form mplayerconf snnspat +antlr forth mrxvtrc snnsres +apache fortran msidl snobol4 +apachestyle foxpro msmessages solidity +aptconf framescript msql spec +arch freebasic mupad specman +arduino fstab mush spice +art fvwm mustache splint +asciidoc fvwm2m4 muttrc spup +asm gdb mysql spyce +asm68k gdmo named sql +asmh8300 gedcom nanorc sqlanywhere +asn git nasm sqlforms +aspperl gitcommit nastran sqlhana +aspvbs gitconfig natural sqlinformix +asterisk gitolite ncf sqlj +asteriskvm gitrebase netrc sqloracle +atlas gitsendemail netrw sqr +augeas gkrellmrc nginx squid +autohotkey glsl nim srec +autoit gnash ninja sshconfig +automake gnomecat nix sshdconfig +ave gnuplot nosyntax st +avra go nqc stata +awk godefstack nroff stp +ayacc godoc nsis strace +b gohtmltmpl obj stylus +baan gotexttmpl objc sudoers +basic gp objcpp svg +bc gpg ocaml svn +bdf gprof occam swift +bib grads octave syncolor +bib_latexSuite gretl omnimark synload +bindzone groff opencl syntax +blade groovy openroad sysctl +blank group opl systemd +bst grub ora systemverilog +btm gsp pamconf tads +bzl gtkrc papp tags +bzr haml pascal tak +c hamster passwd takcmp +cabal handlebars pcap takout +calendar haskell pccts tap +catalog haste pdf tar +cdl hastepreproc perl taskdata +cdrdaoconf haxe perl6 taskedit +cdrtoc haxe_extended pf tasm +cf hb pfmain tcl +cfg help pgsql tcsh +ch hercules php teraterm +chaiscript hex phtml terminfo +change hgcommit pic tex +changelog hitest pike tex_LatexBox +chaskell hog pilrc tex_latexSuite +cheetah hostconf pine texinfo +chill hostsaccess pinfo texmf +chordpro hss plaintex text +cl html plantuml textile +clean html5 pli tf +clipper htmlcheetah plm thrift +clojure htmldjango plp tidy +cmake htmlm4 plsql tilde +cmake-indent htmlos po tli +cmake-syntax hxml pod tmux +cmusrc ia64 postscr tomdoc +cobol ibasic pov toml +coco icemenu povini tpp +coffee icon ppd trasys +color_coded idl ppwiz treetop +colortest idlang prescribe trustees +conaryrecipe indent privoxy tsalt +conf inform procmail tsscl +config initex progress tssgm +context initng prolog tssop +cpp inittab promela tt2 +cql ipfilter proto tt2html +crm ishd protocols tt2js +crontab iss ps1 twig +cryptol ist ps1xml typescript +crystal j psf uc +cs jal ptcap udevconf +csc jam pug udevperm +cscope_plus jargon puppet udevrules +csdl jasmine purescript uil +csh java purifylog updatedb +csp javacc pyrex upstart +css javascript python upstreamdat +cterm jess qf upstreaminstalllog +ctrlh jgraph qml upstreamlog +cucumber jinja2 quake upstreamrpt +cuda jovial r usserverlog +cupl jproperties racc usw2kagtlog +cuplsim json radiance vala +cuda jovial r usserverlog +cupl jproperties racc usw2kagtlog +cuplsim json radiance vala +cvs jsp ragel valgrind +cvsrc jst ratpoison vb +cweb jsx rc vbnet +cynlib julia rcs vcl +cynpp kconfig rcslog velocity +d kivy readline vera +dart kix rebol verilog +datascript kotlin redif verilogams +dcd kscript registry vgrindefs +dcl kwt remind vhdl +debchangelog lace resolv vim +debcontrol latextoc reva vimgo +debsources latte rexx viminfo +def ld rhelp virata +denyhosts ldapconf rib vmasm +desc ldif rmd voscm +desktop less rnc vrml +dictconf lex rng vroom +dictdconf lftp rnoweb vsejcl +diff lhaskell robots vundlelog +dircolors libao rpcgen wdiff +dirpager lifelines rpl web +diva lilo rrst webmacro +django limits rspec wget +dns liquid rst whitespace +dnsmasq lisp rtf winbatch +docbk lite ruby wml +docbksgml litestep rust wsh +docbkxml logcheck samba wsml +dockerfile loginaccess sas wvdial +dosbatch logindefs sass xbl +dosini logtalk sather xdefaults +dot lotos sbt xf86conf +doxygen lout scala xhtml +dracula lpc scala.xpt xinetd +dsl lprolog scheme xkb +dtd lscript scilab xmath +dtml lsl screen xml +dtrace lss scss xmodmap +dts lua sd xpm +dylan lynx sdc xpm2 +dylanintr m4 sdl xquery +dylanlid mail sed xs +ecd mailaliases sendpr xsd +edif mailcap sensors xsl +eelixir make services xslt +eiffel mallard setserial xxd +elf man sgml yacc +elinks manconf sgmldecl yaml +elixir manual sgmllnx z8a +elm maple sh zimbu +elmfilt markdown sicad zsh +ember-script masm sieve +emblem mason simula + diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index 9c168f9..4e49e6d 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt @@ -1,50 +1,60 @@ +leader key = usually set to backslash expects a quick command + + [normal mode] -f{char} - move cursor to the character {char} +f{char} = move cursor to the character {char} -[visual mode] - with selected lines -gq - formats text so that it fits in whatever :set textwidth was set -iB - select block between curly braces (:help object-select) +[visual mode] # with selected lines +gq = formats text so that it fits in whatever :set textwidth was set +iB = select block between curly braces (:help object-select) [commands] -:spell [word] - adds a word to the current dictionary (no mistake any more) -:set list - display non printable characters -:retab - replaces tabs with spaces -:set expandtab - in insert mode: replace tab with spaces +:spell [word] = adds a word to the current dictionary (no mistake any more) +:set list = display non printable characters +:retab = replaces tabs with spaces +:set expandtab = in insert mode: replace tab with spaces +:Explore = cli version open file dialog [navigation] - - look up the tag under the cursor (help links as well) - - return back from tag under the cursor + = look up the tag under the cursor (help links as well) + = return back from tag under the cursor +gd = jump to the declaration of the variable under the cursor -[macros] - record and play back a series of vim commands -qa - start (q) macro recording in register a (can be anything) -q - stop macro recording -@a - replay macro a -:'<,'>normal @a - apply a to every line in the current selection +[macros] # record and play back a series of vim commands +qa = start (q) macro recording in register a (can be anything) +q = stop macro recording +@a = replay macro a +:'<,'>normal @a = apply a to every line in the current selection [marker] -ma - set marker a-z (a in this case) -'a - go to marker a +ma = set marker a-z (a in this case) +'a = go to marker a [hotkeys] -, - increment, decrement number under the cursor +, = increment, decrement number under the cursor [windows] -v - splits buffer vertically (screen uses |) -s - splits buffer horizontally (same as screen) -w - moves the cursor to the next window and back -[dir] - moves the cursor in that direction (use hjkl or arrow keys) +v = splits buffer vertically (screen uses |) +s = splits buffer horizontally (same as screen) +w = moves the cursor to the next window and back +[dir] = moves the cursor in that direction (use hjkl or arrow keys) [vimdiff] -do - get changes from other window into the current -dp - put changes from current window into the other -]c - jump to the next change -[c - jump to the prevous change -zR - opens all folds (unfold all) +do = get changes from other window into the current +dp = put changes from current window into the other +]c = jump to the next change +[c = jump to the prevous change +zR = opens all folds (unfold all) + +[vim modeline] +the last line can be a mode line, which holds settings like tab width: + +# vim: noai:ts=2:sw=2 filetype=dosini diff --git a/vimrc b/vimrc index e57b242..2443738 100644 --- a/vimrc +++ b/vimrc @@ -7,22 +7,30 @@ set rtp+=~/.vim/bundle/Vundle.vim | " set runtimepath (requir call vundle#begin('~/.vim/bundle/') | " location where Vundle searches&installs plugins " Plugin dependant configurations... -Plugin 'VundleVim/Vundle.vim' | " Vundle itself (required) +Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin Plugin 'jeaye/color_coded' | " semantic highlighting with vim Plugin 'terryma/vim-multiple-cursors' | " displays visual block mode as cursors - Plugin 'taglist-plus' | " quick code navigator Plugin 'jdonaldson/vaxe' | " code completion for haxe Plugin 'sheerun/vim-polyglot' | " better syntax highlighting/indentation for multiple languages Plugin 'loremipsum' | " Sample text generator +Plugin 'vim-airline/vim-airline' | " beautification of the mode line +Plugin 'nathanaelkane/vim-indent-guides' | " shows indentation guidelines by pressing ig +Plugin 'gregsexton/matchtag' | " highlights closing ML tags like braces +Plugin 'indenthtml.vim' | " works better with mixed html/css/javascript +Plugin 'easymotion/vim-easymotion' | " speed up navigation: try \\w or \\f, then one of the highlighted chars +Plugin 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' + + + let Tlist_Compact_Format = 1 | " let Tlist_GainFocus_On_ToggleOpen = 1 | " let Tlist_Close_On_Select = 1 | " -Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion +Plugin 'VundleVim/Vundle.vim' | " Vundle itself (required) let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py' | " fallback, right one should be in the applications path let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' let g:ycm_key_select_completion = '' | " key completion key @@ -34,12 +42,27 @@ let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle let html_use_css = 1 | " when using :TOhtml no font-tags will be used, but proper css +let g:vim_markdown_folding_disabled=1 | " disable code folding with vimdiff (also see set nofoldenable) + +let g:netrw_liststyle=3 | " Explore mode: 3 shows a complete tree instead of the current directory +let g:netrw_list_hide='^\..*' | " Explore mode: hide files starting with dot + + +" speed up CTRL-P Menu... +let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden + \ --ignore .git + \ --ignore .svn + \ --ignore .hg + \ --ignore .DS_Store + \ --ignore "**/*.pyc" + \ -g ""' call vundle#end() | " required by Vundle filetype plugin indent on | " required by Vundle "================================================================================ " custom config -colorscheme coderonline +colorscheme mac_classic +" colorscheme coderonline syntax enable set noswapfile | " noundofile, nobackup, nowritebackup @@ -57,7 +80,7 @@ set selection=exclusive | " includes last character of the selection into set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap -set diffopt+=iwhite,filler | " lets diff ignore white spaces +set diffopt+=vertical,iwhite,filler | " lets diff ignore white spaces set spell spelllang=en,de | " enable spell checker set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore) set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews @@ -66,6 +89,7 @@ set showcmd | " displays status line messages while selecting set nofoldenable | " do not fold code automatically set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include set wildmenu wildmode=full | " wildmenu code completion +set guifont="Droid Sans Mono for Powerline 10" " search... set ignorecase smartcase | " if search pattern contains uppercase then search is case sensitive @@ -76,6 +100,10 @@ set novisualbell | " don't beep set noerrorbells | " don't beep set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) set number | " toggle line numbers +set formatprg=par | " set external formatting program to par, use gwip to format with this +set laststatus=2 | " this is required for airline +set cmdheight=1 | " controls how many lines the command line has +set relativenumber | " displays current lines line no as zero point from where relative numbers are getting counted if has("multi_byte") set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) @@ -108,6 +136,7 @@ if has("autocmd") \ setlocal omnifunc=syntaxcomplete#Complete | \ setlocal completeopt=longest,menuone | \ endif + autocmd FileType html set omnifunc=htmlcomplete#CompleteTags endif augroup END @@ -158,6 +187,30 @@ endif "================================================================================ " custom commands... +" +" assign selection keys (these i missed a lot) +nmap vh| " shift-left selects to the left +xmap h| " ^^ +nmap vl| " shift-right selects to the right +xmap l| " ^^ +nmap vk| " shift-up selects like other text editors +xmap k| " ^^ +nmap vj| " shift down selects like other text editors +xmap j| " ^^ +nmap ^| " default homing in code editors is the first letter of a line +xmap 0| " go to the beginning of the line +xmap 0| " ^^ +xmap >gv| " indent lines (and retain selection) +xmap VH| " selects predessing paragraph +nmap VL| " selects following paragraph +nmap V{| " selects predessing paragraph +nmap V}| " selects following paragraph + + + + + map h|map j| " window navigation shortcuts map k|map l| " window navigation shortcuts @@ -171,15 +224,14 @@ nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before nnoremap g$| " and make the key position the cursor after the last char of that line -function ExtendedHome() - let column = col('.') - normal! ^ - if column == col('.') - normal! 0 - endif -endfunction -noremap ^ -noremap :call ExtendedHome() +" function ExtendedHome() +" let column = col('.') +" normal! ^ +" if column == col('.') +" normal! 0 +" endif +" endfunction +" noremap :call ExtendedHome() nnoremap u @@ -198,7 +250,6 @@ inoremap ( (| " when opening a bracket: call the OmniCo set makeprg=make\ test nnoremap :!make| " classic key binding: press F5 to compile and execute (if you have a Makefile with make test doing that) - "================================================================================ " deactivated on-demand commands (just in case one needs them one day) " -- cgit v1.2.3