diff --git a/.gitignore b/.gitignore index fcd639eb..f2041904 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -.netrwhist -vim/bundle/* +nvim/.netrwhist +nvim/dein/ diff --git a/README.md b/README.md index 55f4c965..63decdb8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This is a collection of my dotfiles. +## Installation + ``` git clone git://github.com/webgefrickel/dotfiles ~/dotfiles cd ~/dotfiles @@ -22,7 +24,14 @@ provide your git credentials, such as: Finally restart your terminal and vim again, and you are ready to go. -## VIM +## Additional stuff + +There are additional installation script for commonly used +CLI-tools and software (mainly macOS specific) and some color +schemes for different terminal emulators, see the folders +install/, alfred/ and other/. + +## Vim -I use a lot of plugins and custom syntaxes. They are all -installed via neobundle - for a list of the plugins see vimrc. +I use neovim as a default, with some selected plugins. Those +plugins are managed with dein, see nvim/bundles.vim. diff --git a/gitconfig b/gitconfig index 83760a3a..6d031d8a 100644 --- a/gitconfig +++ b/gitconfig @@ -45,25 +45,19 @@ ps = push pl = pull mg = merge - rbc = rebase --continue ffs = flow feature start fff = flow feature finish ffp = flow feature publish fi = flow init - unst = reset HEAD - hub = push origin master - fac = push origin refac rs = reset HEAD --hard hist = log --pretty=format:\"%h | %ad | %an | %s%d \" --graph --date=local l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(blue)<%an>%Creset' --abbrev-commit lo = log --graph --decorate --pretty=oneline --abbrev-commit --all pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master" - type = cat-file -t - dump = cat-file -p [diff] - tool = vimdiff - guitool = vimdiff + tool = nvim -d + guitool = nvim -d compactionHeuristic = true [mergetool] diff --git a/nvim/autocommands.vim b/nvim/autocommands.vim index d964a182..5e0fea66 100644 --- a/nvim/autocommands.vim +++ b/nvim/autocommands.vim @@ -1,8 +1,5 @@ -" autocommands, filetypes, spelling, keywords for specific filetypes -"====================================================================== - -" define a group `vimrc` and initialize. -augroup vimrc +" define a group `init` and initialize. +augroup init autocmd! " Remember last location/cursor in file @@ -13,17 +10,12 @@ augroup vimrc autocmd BufNewFile,BufRead *.md setlocal wrap " add the dash to keywords -- makes better css/js/html search - " do this for specific files only (not in php/rb e.g.) - autocmd BufNewFile,BufRead *.{js,scss,html} set iskeyword+=- - autocmd BufNewFile,BufRead *.{js,scss,html} set iskeyword-=_ + " do this for specific files only (not in php/rb e.g.) where dashes are + " not used in variable names (use camelCase instead here) + autocmd BufNewFile,BufRead *.{js,css,scss,html} set iskeyword+=- + autocmd BufNewFile,BufRead *.{js,css,scss,html} set iskeyword-=_ autocmd BufNewFile,BufRead *.php set iskeyword-=- - " scss.css snippets and stuff - autocmd BufNewFile,BufRead *.scss set filetype=scss.css - - " Syntaxes for other files - autocmd BufNewFile,BufRead *.twig set filetype=html.twig - " omnicompletion for some filetypes autocmd FileType css,scss setlocal omnifunc=csscomplete#CompleteCSS autocmd FileType html,php,twig setlocal omnifunc=htmlcomplete#CompleteTags diff --git a/nvim/bundles.vim b/nvim/bundles.vim index 0e74b28c..06928490 100644 --- a/nvim/bundles.vim +++ b/nvim/bundles.vim @@ -1,24 +1,18 @@ -" All bundles, syntaxes and plugins -"====================================================================== - -" TODO Replace those with the de-versions -" NeoBundle 'Shougo/neocomplete' -call dein#add('Shougo/neosnippet') -" NeoBundle 'Shougo/unite.vim' call dein#add('Shougo/deoplete.nvim') -call dein#add('junegunn/fzf', { 'build': './install --all' }) -call dein#add('junegunn/fzf.vim') -call dein#add('cakebaker/scss-syntax.vim') +call dein#add('Shougo/neosnippet') +call dein#add('cakebaker/scss-syntax.vim', { 'on_ft': [ 'scss', 'css'] }) call dein#add('christoomey/vim-tmux-navigator') call dein#add('cocopon/lightline-hybrid.vim') call dein#add('editorconfig/editorconfig-vim') -call dein#add('gcorne/vim-sass-lint') +" call dein#add('gcorne/vim-sass-lint') call dein#add('haya14busa/incsearch.vim') call dein#add('itchyny/lightline.vim') +call dein#add('junegunn/fzf', { 'merged': 0 }) +call dein#add('junegunn/fzf.vim', { 'depends': 'fzf' }) call dein#add('justinmk/vim-sneak') -call dein#add('moll/vim-node') -call dein#add('mtscout6/syntastic-local-eslint.vim') -call dein#add('scrooloose/syntastic') +call dein#add('moll/vim-node', { 'on_ft': 'javascript' }) +" call dein#add('mtscout6/syntastic-local-eslint.vim', { 'on_ft': 'javascript' }) +" call dein#add('scrooloose/syntastic') call dein#add('sheerun/vim-polyglot') call dein#add('tpope/vim-commentary') call dein#add('tpope/vim-fugitive') @@ -30,3 +24,8 @@ call dein#add('tpope/vim-vinegar') call dein#add('w0ng/vim-hybrid') call dein#add('webgefrickel/vim-snippets') call dein#add('wellle/tmux-complete.vim') +call dein#add('itmammoth/doorboy.vim') + +" test those +call dein#add('tyru/open-browser.vim') +call dein#add('w0rp/ale') diff --git a/nvim/colorscheme.vim b/nvim/colorscheme.vim deleted file mode 100644 index a86eef21..00000000 --- a/nvim/colorscheme.vim +++ /dev/null @@ -1,17 +0,0 @@ -" colorscheme and optical stuff -"====================================================================== - -" custom list/invisible chars -set list! " nice Whitespace chars -set listchars=extends:»,precedes:«,tab:▸\ ,trail:· -set fillchars= - -set laststatus=2 " statusbar is 2 high -set cmdheight=2 " command window is 2 high -set cpoptions+=$ " Add a $ to the end of a selection -set cpoptions+=J " 2 spaces after a sentence for easier text manupulation - -let g:hybrid_reduced_contrast = 0 -let g:hybrid_custom_term_colors = 1 -set background=dark -colorscheme hybrid diff --git a/nvim/defaultconfig.vim b/nvim/config.vim similarity index 69% rename from nvim/defaultconfig.vim rename to nvim/config.vim index 10111297..164e13e2 100644 --- a/nvim/defaultconfig.vim +++ b/nvim/config.vim @@ -1,6 +1,3 @@ -" Default sane config -"====================================================================== - filetype plugin indent on syntax on @@ -33,6 +30,39 @@ set complete-=i " dont complete from files set nrformats-=octal " nobody uses octal anyway set display+=lastline " shorten long lastlines set formatoptions+=j " Delete comment character when joining commented lines +set ignorecase +set smartcase +set hlsearch +set showmatch +set wrapscan +set wildmode=list:longest,list:full +set wildmenu +set foldignore= +set foldmethod=indent " indent folding +set foldnestmax=20 " max 20 levels of folding +set nofoldenable " dont fold by default - let me do it +set foldlevelstart=1 " deactivate folding on fileload +set fileformat=unix +set tabstop=2 +set softtabstop=2 +set shiftwidth=2 +set shiftround +set smarttab +set expandtab +set autoindent +set list! " nice Whitespace chars +set listchars=extends:»,precedes:«,tab:▸\ ,trail:· +set fillchars= +set laststatus=2 " statusbar is 2 high +set cmdheight=2 " command window is 2 high +set cpoptions+=$ " Add a $ to the end of a selection +set cpoptions+=J " 2 spaces after a sentence for easier text manupulation + +" hybrid color scheme +let g:hybrid_reduced_contrast = 0 +let g:hybrid_custom_term_colors = 1 +set background=dark +colorscheme hybrid " deactivate syntax highlighting when diffing if &diff diff --git a/nvim/dein/repos/github.com/Shougo/dein.vim b/nvim/dein/repos/github.com/Shougo/dein.vim deleted file mode 160000 index 1dd1f3e8..00000000 --- a/nvim/dein/repos/github.com/Shougo/dein.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1dd1f3e8bc541fceec2fc496185b1908615e7c35 diff --git a/nvim/dein/repos/github.com/Shougo/deoplete.nvim b/nvim/dein/repos/github.com/Shougo/deoplete.nvim deleted file mode 160000 index f1e3724b..00000000 --- a/nvim/dein/repos/github.com/Shougo/deoplete.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f1e3724bd0b2cbe9dce26261d0939e49d1b96374 diff --git a/nvim/dein/repos/github.com/Shougo/neosnippet b/nvim/dein/repos/github.com/Shougo/neosnippet deleted file mode 160000 index c179a51f..00000000 --- a/nvim/dein/repos/github.com/Shougo/neosnippet +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c179a51f024e27edf4354a52ff8b9fa69c4c803c diff --git a/nvim/dein/repos/github.com/cakebaker/scss-syntax.vim b/nvim/dein/repos/github.com/cakebaker/scss-syntax.vim deleted file mode 160000 index 4461789d..00000000 --- a/nvim/dein/repos/github.com/cakebaker/scss-syntax.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4461789d02f81fd328afbdf27d6404b6c763c25f diff --git a/nvim/dein/repos/github.com/christoomey/vim-tmux-navigator b/nvim/dein/repos/github.com/christoomey/vim-tmux-navigator deleted file mode 160000 index e79d4c0c..00000000 --- a/nvim/dein/repos/github.com/christoomey/vim-tmux-navigator +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e79d4c0c24c43d3ada283b1f5a1b8fa6cf820a70 diff --git a/nvim/dein/repos/github.com/cocopon/lightline-hybrid.vim b/nvim/dein/repos/github.com/cocopon/lightline-hybrid.vim deleted file mode 160000 index ef45bdd6..00000000 --- a/nvim/dein/repos/github.com/cocopon/lightline-hybrid.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ef45bdd664cf8df6bf4d016ea13ae54b1d92a4dd diff --git a/nvim/dein/repos/github.com/editorconfig/editorconfig-vim b/nvim/dein/repos/github.com/editorconfig/editorconfig-vim deleted file mode 160000 index a459b8cf..00000000 --- a/nvim/dein/repos/github.com/editorconfig/editorconfig-vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a459b8cfef00100da40fd69c8ae92c4d1e63e1d2 diff --git a/nvim/dein/repos/github.com/gcorne/vim-sass-lint b/nvim/dein/repos/github.com/gcorne/vim-sass-lint deleted file mode 160000 index b9ff3314..00000000 --- a/nvim/dein/repos/github.com/gcorne/vim-sass-lint +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b9ff33141294c7af143f12687e9b1cf9a3a54e0f diff --git a/nvim/dein/repos/github.com/haya14busa/incsearch.vim b/nvim/dein/repos/github.com/haya14busa/incsearch.vim deleted file mode 160000 index 161c5b66..00000000 --- a/nvim/dein/repos/github.com/haya14busa/incsearch.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 161c5b66542e767962ca5f6998a22e984f8d8a60 diff --git a/nvim/dein/repos/github.com/itchyny/lightline.vim b/nvim/dein/repos/github.com/itchyny/lightline.vim deleted file mode 160000 index 059888ab..00000000 --- a/nvim/dein/repos/github.com/itchyny/lightline.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 059888ab650fa192dd441e52bd9f41f08b247529 diff --git a/nvim/dein/repos/github.com/junegunn/fzf b/nvim/dein/repos/github.com/junegunn/fzf deleted file mode 160000 index c7b07640..00000000 --- a/nvim/dein/repos/github.com/junegunn/fzf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c7b076400297e53b3fdb9bb0605b0c688a39fa40 diff --git a/nvim/dein/repos/github.com/junegunn/fzf.vim b/nvim/dein/repos/github.com/junegunn/fzf.vim deleted file mode 160000 index 20666432..00000000 --- a/nvim/dein/repos/github.com/junegunn/fzf.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2066643243eddf2ed1f5d3a1a5485d6ff71851a4 diff --git a/nvim/dein/repos/github.com/justinmk/vim-sneak b/nvim/dein/repos/github.com/justinmk/vim-sneak deleted file mode 160000 index f00084c6..00000000 --- a/nvim/dein/repos/github.com/justinmk/vim-sneak +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f00084c6f9e28e8836c3e4b5dc7e255098843a10 diff --git a/nvim/dein/repos/github.com/moll/vim-node b/nvim/dein/repos/github.com/moll/vim-node deleted file mode 160000 index 13b31218..00000000 --- a/nvim/dein/repos/github.com/moll/vim-node +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 13b31218447335e176d46dd5f497b274f7f49595 diff --git a/nvim/dein/repos/github.com/mtscout6/syntastic-local-eslint.vim b/nvim/dein/repos/github.com/mtscout6/syntastic-local-eslint.vim deleted file mode 160000 index 3700f014..00000000 --- a/nvim/dein/repos/github.com/mtscout6/syntastic-local-eslint.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3700f01459b9532ead77874f8910bf0499e2461c diff --git a/nvim/dein/repos/github.com/scrooloose/syntastic b/nvim/dein/repos/github.com/scrooloose/syntastic deleted file mode 160000 index 675f67ee..00000000 --- a/nvim/dein/repos/github.com/scrooloose/syntastic +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 675f67eea29308537438eb49b3b28a444c1e4689 diff --git a/nvim/dein/repos/github.com/sheerun/vim-polyglot b/nvim/dein/repos/github.com/sheerun/vim-polyglot deleted file mode 160000 index 74652b46..00000000 --- a/nvim/dein/repos/github.com/sheerun/vim-polyglot +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 74652b465d7eff97070001317a4ea5557717378d diff --git a/nvim/dein/repos/github.com/tpope/vim-commentary b/nvim/dein/repos/github.com/tpope/vim-commentary deleted file mode 160000 index 73e0d9a9..00000000 --- a/nvim/dein/repos/github.com/tpope/vim-commentary +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 73e0d9a9d1f51b6cc9dc965f62669194ae851cb1 diff --git a/nvim/dein/repos/github.com/tpope/vim-fugitive b/nvim/dein/repos/github.com/tpope/vim-fugitive deleted file mode 160000 index b754bc20..00000000 --- a/nvim/dein/repos/github.com/tpope/vim-fugitive +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b754bc2031f21a532c083dd0d072ba373bbe3a37 diff --git a/nvim/dein/repos/github.com/tpope/vim-ragtag b/nvim/dein/repos/github.com/tpope/vim-ragtag deleted file mode 160000 index 9378cddc..00000000 --- a/nvim/dein/repos/github.com/tpope/vim-ragtag +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9378cddc1c264f777af59f04e5b8d64eca8ee5fd diff --git a/nvim/dein/repos/github.com/tpope/vim-repeat b/nvim/dein/repos/github.com/tpope/vim-repeat deleted file mode 160000 index 7a6675f0..00000000 --- a/nvim/dein/repos/github.com/tpope/vim-repeat +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7a6675f092842c8f81e71d5345bd7cdbf3759415 diff --git a/nvim/dein/repos/github.com/tpope/vim-surround b/nvim/dein/repos/github.com/tpope/vim-surround deleted file mode 160000 index e49d6c24..00000000 --- a/nvim/dein/repos/github.com/tpope/vim-surround +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e49d6c2459e0f5569ff2d533b4df995dd7f98313 diff --git a/nvim/dein/repos/github.com/tpope/vim-unimpaired b/nvim/dein/repos/github.com/tpope/vim-unimpaired deleted file mode 160000 index 11dc568d..00000000 --- a/nvim/dein/repos/github.com/tpope/vim-unimpaired +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 11dc568dbfd7a56866a4354c737515769f08e9fe diff --git a/nvim/dein/repos/github.com/tpope/vim-vinegar b/nvim/dein/repos/github.com/tpope/vim-vinegar deleted file mode 160000 index bd7f7b79..00000000 --- a/nvim/dein/repos/github.com/tpope/vim-vinegar +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bd7f7b7929260072864462c04dde3b9f4c5e0d23 diff --git a/nvim/dein/repos/github.com/w0ng/vim-hybrid b/nvim/dein/repos/github.com/w0ng/vim-hybrid deleted file mode 160000 index cc58baab..00000000 --- a/nvim/dein/repos/github.com/w0ng/vim-hybrid +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cc58baabeabc7b83768e25b852bf89c34756bf90 diff --git a/nvim/dein/repos/github.com/webgefrickel/vim-snippets b/nvim/dein/repos/github.com/webgefrickel/vim-snippets deleted file mode 160000 index 33090dc5..00000000 --- a/nvim/dein/repos/github.com/webgefrickel/vim-snippets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 33090dc59223641e3daad2006511d18226b327a5 diff --git a/nvim/dein/repos/github.com/wellle/tmux-complete.vim b/nvim/dein/repos/github.com/wellle/tmux-complete.vim deleted file mode 160000 index b6fe12c6..00000000 --- a/nvim/dein/repos/github.com/wellle/tmux-complete.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b6fe12c60389df174a9b244d377b83abd50205f1 diff --git a/nvim/init.vim b/nvim/init.vim index 9728215d..699302a2 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -1,29 +1,14 @@ -" my vimrc - this file basically initalies neobundle and loads -" other config files from vim/config + the plugins-subfolder -"====================================================================== - set langmenu=en_US.UTF-8 set runtimepath+=~/.config/nvim/dein/repos/github.com/Shougo/dein.vim +" let dein handle all the plugins and bundles call dein#begin(expand('~/.config/nvim/dein')) source ~/.config/nvim/bundles.vim call dein#end() " load the default config and mappings -source ~/.config/nvim/defaultconfig.vim -source ~/.config/nvim/search.vim -source ~/.config/nvim/whitespace.vim +source ~/.config/nvim/config.vim source ~/.config/nvim/autocommands.vim -source ~/.config/nvim/colorscheme.vim source ~/.config/nvim/keymappings.vim source ~/.config/nvim/leaderkeys.vim - -" and the configs and mappings for plugins loaded in bundles.vim -source ~/.config/nvim/plugins/fugitive.vim -source ~/.config/nvim/plugins/incsearch.vim -source ~/.config/nvim/plugins/lightline.vim -source ~/.config/nvim/plugins/neosnippet.vim -source ~/.config/nvim/plugins/deoplete.vim -source ~/.config/nvim/plugins/sneak.vim -source ~/.config/nvim/plugins/syntastic.vim -" source ~/.config/nvim/plugins/unite.vim +source ~/.config/nvim/plugins.vim diff --git a/nvim/keymappings.vim b/nvim/keymappings.vim index 222c44ab..64904482 100644 --- a/nvim/keymappings.vim +++ b/nvim/keymappings.vim @@ -1,9 +1,3 @@ -" Custom key mappings and shortcuts -"====================================================================== - -" fix an issue with nvim + c+h for tmux-vim navigation -nnoremap :TmuxNavigateLeft - " remap semi-colon to be colon in normal an visual mode nnoremap ; : vnoremap ; : @@ -46,10 +40,6 @@ vmap ∆ ]egv vmap ˙ gv -" Fast Switch between windows/buffers with tab -nnoremap -nnoremap W - " no help while mishitting ESC - awesome noremap diff --git a/nvim/leaderkeys.vim b/nvim/leaderkeys.vim index 3cc604a7..27c0aa3b 100644 --- a/nvim/leaderkeys.vim +++ b/nvim/leaderkeys.vim @@ -1,6 +1,3 @@ -" take me to your leader! -"====================================================================== - let g:mapleader = "," let g:maplocalleader = "," @@ -22,7 +19,7 @@ nnoremap o :e =expand("%:p:h") . "/" nnoremap y :call system('nc localhost 8377', @0) " Find merge conflict markers -nnoremap g /\v^[<\|=>]{7}( .*\|$) +nnoremap gf /\v^[<\|=>]{7}( .*\|$) " paste keeping indentation nnoremap p p`[v`]= diff --git a/nvim/plugins.vim b/nvim/plugins.vim new file mode 100644 index 00000000..fdb1f284 --- /dev/null +++ b/nvim/plugins.vim @@ -0,0 +1,135 @@ +" deoplete +let g:deoplete#enable_at_startup = 1 +let g:deoplete#enable_smart_case = 1 +let g:deoplete#auto_completion_start_length = 3 + +inoremap deoplete#smart_close_popup().doorboy#map_backspace() +inoremap deoplete#smart_close_popup().doorboy#map_backspace() +inoremap =deoplete_cr_function() + +function! s:deoplete_cr_function() abort + return deoplete#close_popup() . "\" +endfunction + +" fugitive +nnoremap gs :Gstatus20+ +nnoremap gd :Gdiff20+ +nnoremap gc :Gcommit20+ +nnoremap gw :Gwrite20+ + +" incsearch +let g:incsearch#auto_nohlsearch = 1 +let g:incsearch#consistent_n_direction = 1 +let g:incsearch#magic = '\v' +map / (incsearch-forward) +map ? (incsearch-backward) +map g/ (incsearch-stay) +map n (incsearch-nohl-n) +map N (incsearch-nohl-N) +map * (incsearch-nohl-*) +map # (incsearch-nohl-#) +map g* (incsearch-nohl-g*) +map g# (incsearch-nohl-g#) + +" neosnippet +let g:neosnippet#disable_runtime_snippets = { "_": 1 } +let g:neosnippet#scope_aliases = {} +let g:neosnippet#scope_aliases['scss'] = 'scss,css' +let g:neosnippet#scope_aliases['php'] = 'php,html' +let g:neosnippet#snippets_directory = '~/.config/nvim/dein/repos/github.com/webgefrickel/vim-snippets/snippets' + +imap (neosnippet_expand_or_jump) +smap (neosnippet_expand_or_jump) +xmap (neosnippet_expand_target) + +" sneak +let g:sneak#use_ic_scs = 0 +let g:sneak#map_netrw = 1 +let g:sneak#s_next = 1 +let g:sneak#streak = 1 + +" openbrowser +let g:netrw_nogx = 1 " disable netrw's gx mapping. +nmap gx (openbrowser-smart-search) +vmap gx (openbrowser-smart-search) + +" ale +let g:ale_lint_on_save = 1 +let g:ale_lint_on_text_changed = 0 +let g:ale_lint_on_enter = 1 +let g:ale_linters = { + \ 'css': [], + \ 'html': ['htmlhint'], + \ 'javascript': ['eslint'], + \ 'sass': ['sasslint'], + \ 'scss': ['sasslint'], +\} + +" fzf +nnoremap , :Files +nnoremap . :Buffers +nnoremap g :GFiles +nnoremap c :GFiles? +nnoremap l :Lines +nnoremap a :Ag +nnoremap r :History: + +" lightline +let g:lightline = { + \ 'colorscheme': 'hybrid', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ], + \ 'right': [ [ 'lineinfo' ], [ 'fileformat', 'fileencoding', 'filetype' ] ] + \ }, + \ 'component_function': { + \ 'modified': 'LightlineModified', + \ 'readonly': 'LightlineReadonly', + \ 'fugitive': 'LightlineFugitive', + \ 'filename': 'LightlineFilename', + \ 'fileformat': 'LightlineFileformat', + \ 'filetype': 'LightlineFiletype', + \ 'fileencoding': 'LightlineFileencoding', + \ 'mode': 'LightlineMode', + \ } +\ } + +function! LightlineModified() + return &ft =~ 'help' ? '' : &modified ? 'ɱ' : &modifiable ? '' : 'ɯ' +endfunction + +function! LightlineReadonly() + return &ft !~? 'help' && &readonly ? 'ɹ' : '' +endfunction + +function! LightlineFilename() + return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') . + \ (&ft == 'unite' ? unite#get_status_string() : + \ '' != expand('%:t') ? expand('%:t') : '[No Name]') . + \ (LightlineModified() != '' ? ' ' . LightlineModified() : '') . + \ (ALEGetStatusLine() != 'OK' ? ' - ' . ALEGetStatusLine() : '') +endfunction + +function! LightlineFugitive() + if exists("*fugitive#head") + let _ = fugitive#head() + return strlen(_) ? 'ɓ '._ : '' + endif + return '' +endfunction + +function! LightlineFileformat() + return winwidth(0) > 70 ? &fileformat : '' +endfunction + +function! LightlineFiletype() + return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : '' +endfunction + +function! LightlineFileencoding() + return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : '' +endfunction + +function! LightlineMode() + let fname = expand('%:t') + return winwidth(0) > 70 ? lightline#mode() : '' +endfunction diff --git a/nvim/plugins/deoplete.vim b/nvim/plugins/deoplete.vim deleted file mode 100644 index 5ea6f27b..00000000 --- a/nvim/plugins/deoplete.vim +++ /dev/null @@ -1,17 +0,0 @@ -" deoplete -"====================================================================== - -let g:deoplete#enable_at_startup = 1 -let g:deoplete#enable_smart_case = 1 -let g:deoplete#auto_completion_start_length = 3 - -" , : close popup and delete backword char. -inoremap deoplete#smart_close_popup()."\" -inoremap deoplete#smart_close_popup()."\" - -" : close popup and save indent. -inoremap =my_cr_function() -function! s:my_cr_function() abort - return deoplete#close_popup() . "\" -endfunction - diff --git a/nvim/plugins/fugitive.vim b/nvim/plugins/fugitive.vim deleted file mode 100644 index 7aebc3eb..00000000 --- a/nvim/plugins/fugitive.vim +++ /dev/null @@ -1,7 +0,0 @@ -" Fugitive -"====================================================================== - -nnoremap gs :Gstatus20+ -nnoremap gd :Gdiff20+ -nnoremap gc :Gcommit20+ -nnoremap gw :Gwrite20+ diff --git a/nvim/plugins/incsearch.vim b/nvim/plugins/incsearch.vim deleted file mode 100644 index fc41aebf..00000000 --- a/nvim/plugins/incsearch.vim +++ /dev/null @@ -1,15 +0,0 @@ -" incsearch -"====================================================================== - -let g:incsearch#auto_nohlsearch = 1 -let g:incsearch#consistent_n_direction = 1 -let g:incsearch#magic = '\v' -map / (incsearch-forward) -map ? (incsearch-backward) -map g/ (incsearch-stay) -map n (incsearch-nohl-n) -map N (incsearch-nohl-N) -map * (incsearch-nohl-*) -map # (incsearch-nohl-#) -map g* (incsearch-nohl-g*) -map g# (incsearch-nohl-g#) diff --git a/nvim/plugins/lightline.vim b/nvim/plugins/lightline.vim deleted file mode 100644 index 706e83fd..00000000 --- a/nvim/plugins/lightline.vim +++ /dev/null @@ -1,60 +0,0 @@ -" Lightline config -"====================================================================== - -let g:lightline = { - \ 'colorscheme': 'hybrid', - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ], - \ 'right': [ [ 'lineinfo' ], [ 'fileformat', 'fileencoding', 'filetype' ] ] - \ }, - \ 'component_function': { - \ 'modified': 'LightlineModified', - \ 'readonly': 'LightlineReadonly', - \ 'fugitive': 'LightlineFugitive', - \ 'filename': 'LightlineFilename', - \ 'fileformat': 'LightlineFileformat', - \ 'filetype': 'LightlineFiletype', - \ 'fileencoding': 'LightlineFileencoding', - \ 'mode': 'LightlineMode', - \ } - \ } - -function! LightlineModified() - return &ft =~ 'help' ? '' : &modified ? 'ɱ' : &modifiable ? '' : 'ɯ' -endfunction - -function! LightlineReadonly() - return &ft !~? 'help' && &readonly ? 'ɹ' : '' -endfunction - -function! LightlineFilename() - return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') . - \ (&ft == 'unite' ? unite#get_status_string() : - \ '' != expand('%:t') ? expand('%:t') : '[No Name]') . - \ ('' != LightlineModified() ? ' ' . LightlineModified() : '') -endfunction - -function! LightlineFugitive() - if exists("*fugitive#head") - let _ = fugitive#head() - return strlen(_) ? 'ɓ '._ : '' - endif - return '' -endfunction - -function! LightlineFileformat() - return winwidth(0) > 70 ? &fileformat : '' -endfunction - -function! LightlineFiletype() - return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : '' -endfunction - -function! LightlineFileencoding() - return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : '' -endfunction - -function! LightlineMode() - let fname = expand('%:t') - return &ft == 'unite' ? 'Unite' : winwidth(0) > 60 ? lightline#mode() : '' -endfunction diff --git a/nvim/plugins/neosnippet.vim b/nvim/plugins/neosnippet.vim deleted file mode 100644 index ab1be839..00000000 --- a/nvim/plugins/neosnippet.vim +++ /dev/null @@ -1,14 +0,0 @@ -" Neosnippet config -"====================================================================== - -let g:neosnippet#disable_runtime_snippets = { "_": 1 } -let g:neosnippet#scope_aliases = {} -let g:neosnippet#scope_aliases['scss'] = 'scss,css' -let g:neosnippet#scope_aliases['php'] = 'php,html' -let g:neosnippet#snippets_directory = '~/.config/nvim/dein/repos/github.com/webgefrickel/vim-snippets/snippets' - -" Plugin key-mappings, expand with ctrl + j -imap (neosnippet_expand_or_jump) -smap (neosnippet_expand_or_jump) -xmap (neosnippet_expand_target) - diff --git a/nvim/plugins/sneak.vim b/nvim/plugins/sneak.vim deleted file mode 100644 index 4498ee48..00000000 --- a/nvim/plugins/sneak.vim +++ /dev/null @@ -1,7 +0,0 @@ -" Vim sneak -"====================================================================== - -let g:sneak#use_ic_scs = 0 -let g:sneak#map_netrw = 1 -let g:sneak#s_next = 1 -let g:sneak#streak = 1 diff --git a/nvim/plugins/syntastic.vim b/nvim/plugins/syntastic.vim deleted file mode 100644 index 64089371..00000000 --- a/nvim/plugins/syntastic.vim +++ /dev/null @@ -1,15 +0,0 @@ -" Syntastic -"====================================================================== - -" no checking for xhtml/html -let g:syntastic_sass_checkers = ['sass_lint'] -let g:syntastic_scss_checkers = ['sass_lint'] -let g:syntastic_css_checkers = ['sass_lint'] -let g:syntastic_javascript_checkers = ['eslint'] -let g:syntastic_json_checkers = ['jsonlint'] -let g:syntastic_auto_jump = 0 -let g:syntastic_mode_map = { - \ 'mode': 'active', - \ 'active_filetypes': ['php', 'javascript', 'json', 'scss', 'sass', 'css'], - \ 'passive_filetypes': ['xhtml', 'html'] - \ } diff --git a/nvim/plugins/unite.vim b/nvim/plugins/unite.vim deleted file mode 100644 index 70a54f90..00000000 --- a/nvim/plugins/unite.vim +++ /dev/null @@ -1,52 +0,0 @@ -" The Unite Plugin -"====================================================================== - -let g:unite_prompt='❯ ' -let g:unite_source_grep_command='ag' -let g:unite_source_grep_default_opts = - \ '-i --vimgrep --hidden --ignore ' . - \ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr''' -let g:unite_source_grep_recursive_opt='' -let g:unite_split_rule = "botright" -let g:unite_force_overwrite_statusline = 0 - -call unite#filters#matcher_default#use(['matcher_fuzzy']) -call unite#filters#sorter_default#use(['sorter_rank']) -call unite#set_profile('files', 'context.smartcase', 1) -call unite#custom#source('line,outline', 'matchers', 'matcher_fuzzy') -call unite#custom_source('file_rec, file_rec/async, file_mru, file, buffer, grep', - \ 'ignore_pattern', join([ - \ '\.git', - \ '\.svn', - \ '\.sass-cache', - \ '_srcs\/', - \ 'node_modules\/', - \ 'vim\/bundle', - \ '\.\(png\|gif\|jpg\|pdf\|ico\|mp4\|webm\|mp3\|woff\|ttf\|eot\|min\.js\|min\.map\)$', - \ ], '\|')) - -nmap [unite] -nnoremap [unite] - -nnoremap [unite], :Unite -start-insert -toggle -auto-resize file_rec/async -nnoremap [unite]b :Unite -short-source-names -quick-match buffer -nnoremap [unite]. :Unite -start-insert -auto-resize buffer -nnoremap [unite]l :Unite -start-insert -auto-resize line -nnoremap [unite]y :Unite history/yank -nnoremap [unite]f :UniteWithCursorWord -start-insert -toggle -auto-resize file_rec/async -nnoremap [unite]a :Unite grep:. -nnoremap [unite]A :UniteWithCursorWord grep:. - -autocmd FileType unite call s:unite_settings() - -function! s:unite_settings() - nmap (unite_exit) - imap (unite_select_next_line) - imap (unite_select_previous_line) - nmap (unite_redraw) - imap (unite_redraw) - inoremap unite#do_action('split') - nnoremap unite#do_action('split') - inoremap unite#do_action('vsplit') - nnoremap unite#do_action('vsplit') -endfunction diff --git a/nvim/search.vim b/nvim/search.vim deleted file mode 100644 index a735a6a6..00000000 --- a/nvim/search.vim +++ /dev/null @@ -1,17 +0,0 @@ -" Searching, completion and folds -"====================================================================== - -set ignorecase -set smartcase -set hlsearch -set showmatch -set wrapscan - -set wildmode=list:longest,list:full -set wildmenu - -set foldignore= -set foldmethod=indent " indent folding -set foldnestmax=20 " max 20 levels of folding -set nofoldenable " dont fold by default - let me do it -set foldlevelstart=1 " deactivate folding on fileload diff --git a/nvim/whitespace.vim b/nvim/whitespace.vim deleted file mode 100644 index ee18324f..00000000 --- a/nvim/whitespace.vim +++ /dev/null @@ -1,11 +0,0 @@ -" Tabs and Whitespace -- can be overridden by editorconfig -"====================================================================== - -set fileformat=unix -set tabstop=2 -set softtabstop=2 -set shiftwidth=2 -set shiftround -set smarttab -set expandtab -set autoindent diff --git a/tmux.conf b/tmux.conf index a3bef81a..37775f39 100644 --- a/tmux.conf +++ b/tmux.conf @@ -53,7 +53,6 @@ bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" - # Mouse support set -g mouse on bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" @@ -73,7 +72,7 @@ set-option -g assume-paste-time 0 # How long should we show any messages? set -g display-time 2000 -# statusbar colors solarized dark +# statusbar colors set -g status-bg black set -g status-fg yellow set -g status-attr default diff --git a/zsh/aliases b/zsh/aliases index ad288bb1..7912f3e8 100644 --- a/zsh/aliases +++ b/zsh/aliases @@ -1,8 +1,7 @@ # make aliases and other stuff work in sudo alias sudo='sudo ' -# always use macvim but for 'vim' -alias nvim=$EDITOR +# always use nvim, see exports alias vim=$EDITOR alias vi=$EDITOR alias v=$EDITOR @@ -40,8 +39,6 @@ alias ggps='git push origin $(current_branch)' alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)' alias gsmu='git submodule init && git submodule update' alias gsmuu='git submodule foreach git pull origin master' -alias gsvn='git checkout master && git svn fetch && git merge dev && git svn rebase && git svn dcommit' -alias ggall='git remote | xargs -L1 git push --all' alias gmo='$EDITOR $(git ls-files -m)' # aliases for apache and mysql @@ -80,7 +77,6 @@ alias dot='cd ~/Dotfiles && ls -al' # random usefull stuff alias dnsflush='sudo dscacheutil -flushcache' -alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" alias lock="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend" # imagemagick downsampling shortcuts (c&p retina folder, run, done!) diff --git a/zsh/exports b/zsh/exports index 28d6d6e6..c8004641 100644 --- a/zsh/exports +++ b/zsh/exports @@ -12,6 +12,7 @@ export MANPATH=/usr/local/share/man:$MANPATH # rbenv export PATH="$HOME/.rbenv/bin:$PATH" +# zsh-completions fpath=($HOME/dotfiles/zsh/zsh-completions/src $fpath) # disable stupid ._ and dsstore files @@ -19,8 +20,8 @@ export COPY_EXTENDED_ATTRIBUTES_DISABLE=true export COPYFILE_DISABLE=true # editor -export EDITOR="/usr/local/bin/nvim -export VISUAL="/usr/local/bin/nvim +export EDITOR="/usr/local/bin/nvim" +export VISUAL="/usr/local/bin/nvim" # disable auto titling fixes tmux window export DISABLE_AUTO_TITLE=true diff --git a/zsh/functions b/zsh/functions index b7b9c3b2..0f6e33a1 100644 --- a/zsh/functions +++ b/zsh/functions @@ -30,11 +30,6 @@ function webvideolownoaudio() { ffmpeg -i $1 -movflags +faststart -an -vcodec libx264 -vprofile high -preset slower -pix_fmt yuv420p -r 25 -b:v 1M -maxrate 1M -bufsize 2M -s 1280x720 $1--low--no-audio.mp4 } -# a small function for finding stuff -function fname() { - find . -iname "*$@*"; -} - # create and change to directory/folder function take() { mkdir -p $1 @@ -59,11 +54,6 @@ fancy-ctrl-z () { fi } -# open changed files in git index -function gch () { - nvim `git status | grep modified | awk '{print $3}'` -} - # creates an archive from given directory mktar() { tar cvf "${1%%/}.tar" "${1%%/}"; } mktgz() { tar cvzf "${1%%/}.tgz" "${1%%/}"; } diff --git a/zshrc b/zshrc index 1f270407..47250d11 100644 --- a/zshrc +++ b/zshrc @@ -1,10 +1,10 @@ -# Load the functions, aliases, function etc. +# Load the functions, aliases and exports for file in ~/dotfiles/zsh/{exports,aliases,functions}; do [ -r "$file" ] && source "$file" done unset file -# a nice prompt +# a nice prompt, install it via npm to make this work autoload -U promptinit; promptinit prompt pure @@ -19,13 +19,12 @@ compdef gf=git-flow # case-insensitive (all),partial-word and then substring completion zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' -unsetopt menu_complete # do not autoselect the first completion entry unsetopt flowcontrol +unsetopt menu_complete # do not autoselect the first completion entry setopt auto_menu # show completion menu on succesive tab press setopt complete_in_word setopt always_to_end - # history settings if [ -z $HISTFILE ]; then HISTFILE=$HOME/.zsh_history @@ -33,9 +32,6 @@ fi HISTSIZE=10000 SAVEHIST=10000 -bindkey '\e[A' history-beginning-search-backward -bindkey '\e[B' history-beginning-search-forward - # easy vim/terminal switch zle -N fancy-ctrl-z bindkey '^Z' fancy-ctrl-z