wait I don't use vim any longer
This commit is contained in:
parent
d1918933b5
commit
94a9143def
@ -1,195 +0,0 @@
|
|||||||
"Copyright 2015 Google Inc. All Rights Reserved.
|
|
||||||
|
|
||||||
"Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
"you may not use this file except in compliance with the License.
|
|
||||||
"You may obtain a copy of the License at
|
|
||||||
|
|
||||||
" http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
"Unless required by applicable law or agreed to in writing, software
|
|
||||||
"distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
"See the License for the specific language governing permissions and
|
|
||||||
"limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
"Name: Primary
|
|
||||||
"Description: A Vim color scheme based on Google's colors
|
|
||||||
"Author: Lisie Michel
|
|
||||||
"Created: 2015 March 20
|
|
||||||
"Modified: 2015 April 21
|
|
||||||
"GitHub: https://github.com/google/vim-colorscheme-primary
|
|
||||||
|
|
||||||
hi clear
|
|
||||||
if exists('syntax_on')
|
|
||||||
syntax reset
|
|
||||||
endif
|
|
||||||
let g:colors_name='primary'
|
|
||||||
|
|
||||||
if (has("gui_running")) "Graphical Vim
|
|
||||||
"Set color palette with RGB colors
|
|
||||||
let s:RED = "#DB4437"
|
|
||||||
let s:GREEN = "#0F9D58"
|
|
||||||
let s:YELLOW = "#F4B400"
|
|
||||||
let s:BLUE = "#4285F4"
|
|
||||||
let s:BLACK = "#000000"
|
|
||||||
let s:DGREY = "#656565"
|
|
||||||
let s:LGREY = "#EEEEEE"
|
|
||||||
let s:WHITE = "#FFFFFF"
|
|
||||||
|
|
||||||
"Set gui mode and italics
|
|
||||||
let s:M = "gui"
|
|
||||||
let s:I = "italic"
|
|
||||||
|
|
||||||
else "Console Vim
|
|
||||||
if &t_Co == 256
|
|
||||||
"Set color palette with 256 colors
|
|
||||||
let s:RED = "124"
|
|
||||||
let s:GREEN = "28"
|
|
||||||
let s:YELLOW = "178"
|
|
||||||
let s:BLUE = "69"
|
|
||||||
let s:BLACK = "0"
|
|
||||||
let s:DGREY = "241"
|
|
||||||
let s:LGREY = "255"
|
|
||||||
let s:WHITE = "15"
|
|
||||||
else
|
|
||||||
"Set color palette with color names
|
|
||||||
let s:RED = "red"
|
|
||||||
let s:GREEN = "green"
|
|
||||||
let s:YELLOW = "yellow"
|
|
||||||
let s:BLUE = "blue"
|
|
||||||
let s:BLACK = "black"
|
|
||||||
let s:DGREY = "grey"
|
|
||||||
let s:LGREY = "grey"
|
|
||||||
let s:WHITE = "white"
|
|
||||||
endif
|
|
||||||
|
|
||||||
"Set terminal mode and italics (if supported)
|
|
||||||
let s:M = "cterm"
|
|
||||||
let s:I = "none"
|
|
||||||
let s:terms=["rxvt", "gnome-terminal"]
|
|
||||||
for term in s:terms
|
|
||||||
if $TERM_PROGRAM =~ term
|
|
||||||
let s:I = "italic"
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
"Reverse greyscale for light vs dark modes
|
|
||||||
if &background == "dark"
|
|
||||||
let s:GREY0 = s:WHITE
|
|
||||||
let s:GREY1 = s:LGREY
|
|
||||||
let s:GREY2 = s:DGREY
|
|
||||||
let s:BG = s:BLACK
|
|
||||||
else "light
|
|
||||||
let s:GREY0 = s:BLACK
|
|
||||||
let s:GREY1 = s:DGREY
|
|
||||||
let s:GREY2 = s:LGREY
|
|
||||||
let s:BG = s:WHITE
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" Colors for Syntax Highlighting.
|
|
||||||
exe "hi String ".s:M."bg=".s:BG ." ".s:M."fg=".s:RED ." ".s:M."=".s:I
|
|
||||||
exe "hi Character ".s:M."bg=".s:BG ." ".s:M."fg=".s:RED ." ".s:M."=".s:I
|
|
||||||
exe "hi Conditional ".s:M."bg=".s:BG ." ".s:M."fg=".s:RED ." ".s:M."=bold"
|
|
||||||
exe "hi Label ".s:M."bg=".s:BG ." ".s:M."fg=".s:RED ." ".s:M."=bold"
|
|
||||||
exe "hi Repeat ".s:M."bg=".s:BG ." ".s:M."fg=".s:RED ." ".s:M."=bold"
|
|
||||||
exe "hi Statement ".s:M."bg=".s:BG ." ".s:M."fg=".s:RED ." ".s:M."=bold"
|
|
||||||
exe "hi Keyword ".s:M."bg=".s:BG ." ".s:M."fg=".s:RED ." ".s:M."=bold"
|
|
||||||
exe "hi Exception ".s:M."bg=".s:BG ." ".s:M."fg=".s:RED ." ".s:M."=bold"
|
|
||||||
|
|
||||||
exe "hi Normal ".s:M."bg=".s:BG ." ".s:M."fg=".s:BLUE ." ".s:M."=none"
|
|
||||||
exe "hi Identifier ".s:M."bg=".s:BG ." ".s:M."fg=".s:BLUE ." ".s:M."=bold"
|
|
||||||
exe "hi Function ".s:M."bg=".s:BG ." ".s:M."fg=".s:BLUE ." ".s:M."=bold"
|
|
||||||
|
|
||||||
exe "hi Comment ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREEN." ".s:M."=none"
|
|
||||||
exe "hi Typedef ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREEN." ".s:M."=".s:I
|
|
||||||
exe "hi PreProc ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREEN." ".s:M."=bold"
|
|
||||||
exe "hi Include ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREEN." ".s:M."=bold"
|
|
||||||
exe "hi Define ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREEN." ".s:M."=bold"
|
|
||||||
exe "hi Macro ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREEN." ".s:M."=bold"
|
|
||||||
exe "hi Precondit ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREEN." ".s:M."=bold"
|
|
||||||
exe "hi SpecialComment ".s:M."bg=".s:BG." ".s:M."fg=".s:GREEN." ".s:M."=bold"
|
|
||||||
|
|
||||||
exe "hi Special ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi Delimiter ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi Debug ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi SpecialChar ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY0." ".s:M."=bold"
|
|
||||||
exe "hi Title ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY0." ".s:M."=bold"
|
|
||||||
|
|
||||||
exe "hi Constant ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY1." ".s:M."=none"
|
|
||||||
exe "hi Boolean ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY1." ".s:M."=none"
|
|
||||||
exe "hi Number ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY1." ".s:M."=none"
|
|
||||||
exe "hi Float ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY1." ".s:M."=none"
|
|
||||||
exe "hi Operator ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY1." ".s:M."=bold"
|
|
||||||
exe "hi Tag ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY1." ".s:M."=bold"
|
|
||||||
exe "hi Ignore ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY1." ".s:M."=none"
|
|
||||||
exe "hi Underlined ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY1 ." ".s:M."=underline"
|
|
||||||
|
|
||||||
exe "hi MatchParen ".s:M."bg=".s:RED ." ".s:M."fg=".s:BG ." ".s:M."=none"
|
|
||||||
exe "hi Error ".s:M."bg=".s:RED ." ".s:M."fg=".s:BG ." ".s:M."=none"
|
|
||||||
|
|
||||||
exe "hi Type ".s:M."bg=".s:BG ." ".s:M."fg=".s:YELLOW." ".s:M."=bold"
|
|
||||||
exe "hi StorageClass ".s:M."bg=".s:BG ." ".s:M."fg=".s:YELLOW." ".s:M."=bold"
|
|
||||||
exe "hi Structure ".s:M."bg=".s:BG ." ".s:M."fg=".s:YELLOW." ".s:M."=bold"
|
|
||||||
exe "hi Todo ".s:M."bg=".s:YELLOW." ".s:M."fg=".s:BG ." ".s:M."=none"
|
|
||||||
exe "hi WildMenu ".s:M."bg=".s:YELLOW." ".s:M."fg=".s:BG ." ".s:M."=none"
|
|
||||||
|
|
||||||
exe "hi DiffAdd ".s:M."bg=".s:BLUE ." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi DiffChange ".s:M."bg=".s:GREEN." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi DiffDelete ".s:M."bg=".s:RED ." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi DiffText ".s:M."bg=".s:GREY1." ".s:M."fg="."NONE"." ".s:M."=none"
|
|
||||||
|
|
||||||
|
|
||||||
" Colors for the User Interface.
|
|
||||||
exe "hi Cursor ".s:M."bg=".s:GREY1." ".s:M."fg=".s:BG ." ".s:M."=bold"
|
|
||||||
exe "hi Search ".s:M."bg=".s:YELLOW." ".s:M."fg=".s:BG ." ".s:M."=none"
|
|
||||||
exe "hi IncSearch ".s:M."bg=".s:YELLOW." ".s:M."fg=".s:BG ." ".s:M."=none"
|
|
||||||
exe "hi ColorColumn ".s:M."bg=".s:GREY2." ".s:M."fg="."NONE" ." ".s:M."=none"
|
|
||||||
exe "hi SignColumn ".s:M."bg=".s:GREY2." ".s:M."fg=".s:YELLOW." ".s:M."=none"
|
|
||||||
|
|
||||||
exe "hi WarningMsg ".s:M."bg=".s:BG ." ".s:M."fg=".s:RED ." ".s:M."=bold"
|
|
||||||
exe "hi ErrorMsg ".s:M."bg=".s:BG ." ".s:M."fg=".s:RED ." ".s:M."=bold"
|
|
||||||
exe "hi ModeMsg ".s:M."bg=".s:BG ." ".s:M."fg=".s:BLUE ." ".s:M."=bold"
|
|
||||||
exe "hi MoreMsg ".s:M."bg=".s:BG ." ".s:M."fg=".s:BLUE ." ".s:M."=bold"
|
|
||||||
exe "hi Question ".s:M."bg=".s:BG ." ".s:M."fg=".s:BLUE ." ".s:M."=bold"
|
|
||||||
exe "hi Directory ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREEN." ".s:M."=none"
|
|
||||||
exe "hi SpecialKey ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi Titled ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi NonText ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY1." ".s:M."=bold"
|
|
||||||
exe "hi CursorLineNr ".s:M."bg=".s:BG ." ".s:M."fg=".s:GREY1." ".s:M."=bold"
|
|
||||||
|
|
||||||
exe "hi PmenuSel ".s:M."bg=".s:BLUE ." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi PmenuSBar ".s:M."bg=".s:GREY2." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi PmenuThumb ".s:M."bg=".s:GREY0." ".s:M."fg=".s:BG ." ".s:M."=none"
|
|
||||||
|
|
||||||
if (has("gui_running") || &t_Co == 256)
|
|
||||||
exe "hi Visual ".s:M."bg=".s:GREY2." ".s:M."fg="."NONE" ." ".s:M."=none"
|
|
||||||
exe "hi Pmenu ".s:M."bg=".s:GREY2." ".s:M."fg=".s:GREY0." ".s:M."=none"
|
|
||||||
exe "hi Linenr ".s:M."bg=".s:GREY2." ".s:M."fg=".s:GREY1." ".s:M."=none"
|
|
||||||
exe "hi VertSplit ".s:M."bg=".s:GREY1." ".s:M."fg=".s:GREY2." ".s:M."=none"
|
|
||||||
exe "hi StatusLine ".s:M."bg=".s:GREY1." ".s:M."fg=".s:GREY2." ".s:M."=bold"
|
|
||||||
exe "hi StatusLineNC ".s:M."bg=".s:GREY2." ".s:M."fg=".s:GREY1." ".s:M."=none"
|
|
||||||
exe "hi Folded ".s:M."bg=".s:GREY2." ".s:M."fg=".s:GREY1." ".s:M."=none"
|
|
||||||
exe "hi FoldColumn ".s:M."bg=".s:GREY2." ".s:M."fg=".s:GREY1." ".s:M."=none"
|
|
||||||
else
|
|
||||||
"Eight-color console Vim only supports one shade of grey, so when the FG and
|
|
||||||
"BG should both be shades of grey, console Vim must do it differently.
|
|
||||||
if &background == "dark"
|
|
||||||
let s:GREYX = s:BLACK
|
|
||||||
let s:GREYY = s:GREY1
|
|
||||||
else
|
|
||||||
let s:GREYX = s:GREY1
|
|
||||||
let s:GREYY = s:BLACK
|
|
||||||
endif
|
|
||||||
exe "hi Visual ".s:M."bg=".s:GREYY." ".s:M."fg="."NONE" ." ".s:M."=none"
|
|
||||||
exe "hi Pmenu ".s:M."bg=".s:GREYY." ".s:M."fg=".s:GREYX." ".s:M."=none"
|
|
||||||
exe "hi Linenr ".s:M."bg=".s:GREYX." ".s:M."fg=".s:GREYY." ".s:M."=none"
|
|
||||||
exe "hi VertSplit ".s:M."bg=".s:GREYX." ".s:M."fg=".s:GREYY." ".s:M."=none"
|
|
||||||
exe "hi StatusLine ".s:M."bg=".s:GREYY." ".s:M."fg=".s:GREYX." ".s:M."=bold"
|
|
||||||
exe "hi StatusLineNC ".s:M."bg=".s:GREYX." ".s:M."fg=".s:GREYY." ".s:M."=none"
|
|
||||||
exe "hi Folded ".s:M."bg=".s:GREYX." ".s:M."fg=".s:GREYY." ".s:M."=none"
|
|
||||||
exe "hi FoldColumn ".s:M."bg=".s:GREYX." ".s:M."fg=".s:GREYY." ".s:M."=none"
|
|
||||||
endif
|
|
@ -1,85 +0,0 @@
|
|||||||
" Vim indent file
|
|
||||||
" Language: Haskell
|
|
||||||
" Author: motemen <motemen@gmail.com>
|
|
||||||
" Version: 0.1
|
|
||||||
" Last Change: 2007-07-25
|
|
||||||
"
|
|
||||||
" Modify g:haskell_indent_if and g:haskell_indent_case to
|
|
||||||
" change indentation for `if'(default 3) and `case'(default 5).
|
|
||||||
" Example (in .vimrc):
|
|
||||||
" > let g:haskell_indent_if = 2
|
|
||||||
|
|
||||||
if exists('b:did_indent')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:did_indent = 1
|
|
||||||
|
|
||||||
if !exists('g:haskell_indent_if')
|
|
||||||
" if bool
|
|
||||||
" >>>then ...
|
|
||||||
" >>>else ...
|
|
||||||
let g:haskell_indent_if = 3
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:haskell_indent_case')
|
|
||||||
" case xs of
|
|
||||||
" >>>>>[] -> ...
|
|
||||||
" >>>>>(y:ys) -> ...
|
|
||||||
let g:haskell_indent_case = 5
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal indentexpr=GetHaskellIndent()
|
|
||||||
setlocal indentkeys=!^F,o,O
|
|
||||||
|
|
||||||
function! GetHaskellIndent()
|
|
||||||
let line = substitute(getline(getpos('.')[1] - 1), '\t', repeat(' ', &tabstop), 'g')
|
|
||||||
|
|
||||||
if line =~ '[!#$%&*+./<=>?@\\^|~-]$\|\<do$'
|
|
||||||
return match(line, '\s*where \zs\|\S') + &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
if line =~ '{$'
|
|
||||||
return match(line, '\s*where \zs\|\S') + &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
if line =~ '^\(instance\|class\).*\&.*where$'
|
|
||||||
return &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
if line =~ ')$'
|
|
||||||
let pos = getpos('.')
|
|
||||||
normal k$
|
|
||||||
let paren_end = getpos('.')
|
|
||||||
normal %
|
|
||||||
let paren_begin = getpos('.')
|
|
||||||
call setpos('.', pos)
|
|
||||||
if paren_begin[1] != paren_end[1]
|
|
||||||
return paren_begin[2] - 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if line !~ '\<else\>'
|
|
||||||
let s = match(line, '\<if\>.*\&.*\zs\<then\>')
|
|
||||||
if s > 0
|
|
||||||
return s
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s = match(line, '\<if\>')
|
|
||||||
if s > 0
|
|
||||||
return s + g:haskell_indent_if
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s = match(line, '\<do\s\+\zs[^{]\|\<where\s\+\zs\w\|\<let\s\+\zs\S\|^\s*\zs|\s')
|
|
||||||
if s > 0
|
|
||||||
return s
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s = match(line, '\<case\>')
|
|
||||||
if s > 0
|
|
||||||
return s + g:haskell_indent_case
|
|
||||||
endif
|
|
||||||
|
|
||||||
return match(line, '\S')
|
|
||||||
endfunction
|
|
368
vim/vimrc
368
vim/vimrc
@ -1,368 +0,0 @@
|
|||||||
|
|
||||||
" Vundle plugins {{{
|
|
||||||
" ============================================================================ "
|
|
||||||
|
|
||||||
set nocompatible " be iMproved, required
|
|
||||||
filetype off " required
|
|
||||||
|
|
||||||
" set the runtime path to include Vundle and initialize
|
|
||||||
set rtp+=~/.vim/bundle/Vundle.vim
|
|
||||||
call vundle#begin()
|
|
||||||
|
|
||||||
" let Vundle manage Vundle, required
|
|
||||||
Plugin 'gmarik/Vundle.vim'
|
|
||||||
|
|
||||||
Plugin 'tpope/vim-fugitive'
|
|
||||||
Plugin 'ctrlpvim/ctrlp.vim'
|
|
||||||
Plugin 'bling/vim-airline'
|
|
||||||
Plugin 'scrooloose/nerdtree'
|
|
||||||
Plugin 'Shougo/vimproc.vim'
|
|
||||||
Plugin 'tpope/vim-markdown'
|
|
||||||
Plugin 'altercation/vim-colors-solarized'
|
|
||||||
Plugin 'chriskempson/base16-vim'
|
|
||||||
Plugin 'Valloric/YouCompleteMe'
|
|
||||||
Plugin 'junegunn/vim-easy-align'
|
|
||||||
"Plugin 'LaTeX-Box-Team/LaTeX-Box'
|
|
||||||
Plugin 'chase/vim-ansible-yaml'
|
|
||||||
Plugin 'rust-lang/rust.vim'
|
|
||||||
Plugin 'easymotion/vim-easymotion'
|
|
||||||
|
|
||||||
" All of your Plugins must be added before the following line
|
|
||||||
call vundle#end() " required
|
|
||||||
filetype plugin indent on " required
|
|
||||||
" Put your non-Plugin stuff after this line
|
|
||||||
|
|
||||||
" Configuring NerdTree
|
|
||||||
noremap <C-t> :NERDTreeToggle<CR><CR>
|
|
||||||
let NERDTreeIgnore=[
|
|
||||||
\ ".*\\.class$",
|
|
||||||
\ ".*\\.o$",
|
|
||||||
\ ".*\\.hi$",
|
|
||||||
\ ".*\\.pyc$"
|
|
||||||
\ ]
|
|
||||||
|
|
||||||
let mapleader=';'
|
|
||||||
|
|
||||||
" Configuring ctrlp
|
|
||||||
nnoremap <Leader>l :CtrlP<CR>
|
|
||||||
noremap <C-p> :CtrlP<CR>
|
|
||||||
nnoremap <Leader>o :CtrlPBuffer<CR>
|
|
||||||
noremap <C-o> :CtrlPBuffer<CR>
|
|
||||||
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
|
|
||||||
|
|
||||||
" Configuring Airline
|
|
||||||
let g:airline_powerline_fonts=1
|
|
||||||
|
|
||||||
" Configuring YouCompleteMe
|
|
||||||
let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py'
|
|
||||||
let g:ycm_server_keep_logfiles = 1
|
|
||||||
let g:ycm_server_log_level = 'debug'
|
|
||||||
set completeopt=menu
|
|
||||||
|
|
||||||
" Loading Solarized
|
|
||||||
set t_Co=256
|
|
||||||
let g:solarized_termcolors=256
|
|
||||||
let g:solarized_contrast="normal"
|
|
||||||
let g:solarized_underline=0
|
|
||||||
let g:solarized_termtrans=1
|
|
||||||
|
|
||||||
" Loaing base16
|
|
||||||
let base16colorspace=256
|
|
||||||
|
|
||||||
" Configuring LaTeX-Box
|
|
||||||
"let g:LatexBox_Folding = 1
|
|
||||||
|
|
||||||
" Configuring EasyMotion
|
|
||||||
let g:EasyMotion_do_mapping = 0 " Disable default mappings
|
|
||||||
nmap <Leader>w <Plug>(easymotion-w)
|
|
||||||
nmap <Leader>s <Plug>(easymotion-s)
|
|
||||||
nmap <Leader>j <Plug>(easymotion-j)
|
|
||||||
nmap <Leader>k <Plug>(easymotion-k)
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" General Options {{{
|
|
||||||
" ================================================================== "
|
|
||||||
|
|
||||||
syntax enable
|
|
||||||
set background=dark
|
|
||||||
colorscheme desert
|
|
||||||
silent! colorscheme base16-3024 " conditional colorscheme
|
|
||||||
|
|
||||||
set number " line numbers on the right side
|
|
||||||
set showcmd " show the commands while typing
|
|
||||||
set splitright " open new splits on the right
|
|
||||||
set splitbelow " open new splits below
|
|
||||||
set autoread " autoreload file on change
|
|
||||||
set scrolloff=8 " keep the cursor 8 lines away from the top/bottom
|
|
||||||
set ruler " show the lines/% bottomright
|
|
||||||
set encoding=utf-8 " set default encoding
|
|
||||||
set laststatus=2 " always show the status line
|
|
||||||
|
|
||||||
" wrap lines at 70 characters
|
|
||||||
set formatprg=par\ -w70
|
|
||||||
set formatoptions=tcrqnlj
|
|
||||||
set textwidth=70
|
|
||||||
|
|
||||||
" indentation
|
|
||||||
set tabstop=4 " tab is 4 width
|
|
||||||
set softtabstop=4 " tab is 4 width
|
|
||||||
set shiftwidth=4 " for use with > and <
|
|
||||||
set expandtab " tab key puts spaces
|
|
||||||
set autoindent " in case filetype indent is wrong
|
|
||||||
filetype plugin indent on
|
|
||||||
set list " if tabs, show them with 2 spaces
|
|
||||||
set listchars=tab:\·\ ,trail:·
|
|
||||||
" display tabs with a leading \cdot
|
|
||||||
" trailing whitespace looks like \cdot
|
|
||||||
|
|
||||||
" Don't save tmp/swap files in the current directory.
|
|
||||||
set directory=~/.vim/tmp/swap/
|
|
||||||
set backupdir=~/.vim/tmp/backup/
|
|
||||||
|
|
||||||
" Learning to use decent vim.
|
|
||||||
noremap <Up> <NOP>
|
|
||||||
noremap <Down> <NOP>
|
|
||||||
noremap <Left> <NOP>
|
|
||||||
noremap <Right> <NOP>
|
|
||||||
|
|
||||||
" Keep selection after indenting
|
|
||||||
vnoremap > >gv
|
|
||||||
vnoremap < <gv
|
|
||||||
|
|
||||||
" some shortcuts
|
|
||||||
" go to start of line
|
|
||||||
noremap H ^
|
|
||||||
" go to end of line
|
|
||||||
noremap L g_
|
|
||||||
" fuck you K
|
|
||||||
noremap K <nop>
|
|
||||||
" center screen with <space>
|
|
||||||
noremap <space> zz
|
|
||||||
" rewrite file with sudo
|
|
||||||
cmap w!! w !sudo tee % >/dev/null
|
|
||||||
" paste the clipboard
|
|
||||||
noremap <Leader>p :r!xclip -sel c -o<CR><CR>
|
|
||||||
noremap <Leader>y :w !xclip -sel c<CR><CR>
|
|
||||||
|
|
||||||
" Unfold everything upon opening a new file
|
|
||||||
"autocmd BufRead * normal zR
|
|
||||||
set foldlevelstart=2
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Filetype specific configuration. {{{
|
|
||||||
" ================================================================== "
|
|
||||||
|
|
||||||
" Haskell {{{
|
|
||||||
" ------------------------------------------------------------------ "
|
|
||||||
|
|
||||||
autocmd FileType haskell call HaskellHook()
|
|
||||||
autocmd BufRead,BufNewFile *.lhs call HaskellHook()
|
|
||||||
autocmd BufRead,BufNewFile *.hsc set filetype=haskell
|
|
||||||
|
|
||||||
function HaskellHook()
|
|
||||||
" Ghci shortcut
|
|
||||||
noremap <C-i> :!ghci -Wall '%'<CR><CR>
|
|
||||||
|
|
||||||
" Haskell Styling
|
|
||||||
noremap <C-c> :%!stylish-haskell<CR>
|
|
||||||
noremap <C-x> :!hlint %<CR>
|
|
||||||
|
|
||||||
" Vim-hoogle
|
|
||||||
noremap <C-h> :Hoogle
|
|
||||||
noremap <C-j> :HoogleClose<CR>
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Java {{{
|
|
||||||
" ------------------------------------------------------------------ "
|
|
||||||
|
|
||||||
autocmd FileType java call JavaHook()
|
|
||||||
|
|
||||||
function JavaHook()
|
|
||||||
" Javac shortcut
|
|
||||||
noremap <C-c> :!javac %<CR>
|
|
||||||
|
|
||||||
" Java shortcut
|
|
||||||
noremap <C-i> :!java %:r<CR>
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Shell {{{
|
|
||||||
" ------------------------------------------------------------------ "
|
|
||||||
|
|
||||||
autocmd FileType sh call ShellHook()
|
|
||||||
|
|
||||||
function ShellHook()
|
|
||||||
" Execute in subshell
|
|
||||||
noremap <C-i> :!bash --init-file ./%<CR><CR>
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" C {{{
|
|
||||||
" ------------------------------------------------------------------ "
|
|
||||||
|
|
||||||
autocmd FileType c call CHook()
|
|
||||||
|
|
||||||
function CHook()
|
|
||||||
" gcc shortcut
|
|
||||||
noremap <C-c> :!gcc % -o %:r<CR>
|
|
||||||
|
|
||||||
" execute
|
|
||||||
noremap <C-i> :!./%:r<CR>
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" JavaScript {{{
|
|
||||||
" ------------------------------------------------------------------ "
|
|
||||||
|
|
||||||
autocmd FileType javascript call JavaScriptHook()
|
|
||||||
|
|
||||||
function JavaScriptHook()
|
|
||||||
setlocal tabstop=2
|
|
||||||
setlocal shiftwidth=2
|
|
||||||
setlocal softtabstop=2
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Ruby {{{
|
|
||||||
" ------------------------------------------------------------------ "
|
|
||||||
|
|
||||||
autocmd FileType ruby call RubyHook()
|
|
||||||
autocmd FileType eruby call RubyHook()
|
|
||||||
|
|
||||||
function RubyFold(lnum)
|
|
||||||
if getline(a:lnum) =~ '^\s*def\s' || getline(a:lnum) =~ '^\s*class\s' || getline(a:lnum) =~ '^\s*module\s'
|
|
||||||
return indent(a:lnum) / 2 + 1
|
|
||||||
endif
|
|
||||||
if getline(a:lnum) =~ '^\s*end'
|
|
||||||
return indent(a:lnum) / 2 + 1
|
|
||||||
endif
|
|
||||||
if getline(a:lnum - 1) =~ '^\s*end'
|
|
||||||
return indent(a:lnum - 1) / 2
|
|
||||||
endif
|
|
||||||
return '='
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function RubyFoldText()
|
|
||||||
return getline(v:foldstart) . ' +'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function RubyHook()
|
|
||||||
setlocal tabstop=2
|
|
||||||
setlocal shiftwidth=2
|
|
||||||
set softtabstop=2
|
|
||||||
noremap <C-i> :!irb -Ilib -r ./%<CR><CR>
|
|
||||||
|
|
||||||
" Use rake as makeprogram
|
|
||||||
set makeprg=rake
|
|
||||||
|
|
||||||
" Folding
|
|
||||||
set foldmethod=expr
|
|
||||||
set foldexpr=RubyFold(v:lnum)
|
|
||||||
set foldtext=RubyFoldText()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" R {{{
|
|
||||||
" ------------------------------------------------------------------ "
|
|
||||||
|
|
||||||
autocmd FileType r call RHook()
|
|
||||||
|
|
||||||
function RHook()
|
|
||||||
" Interactive shortcut
|
|
||||||
noremap <C-i> :'<,'>w !R --no-save --interactive<CR><CR>
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Latex {{{
|
|
||||||
" ------------------------------------------------------------------ "
|
|
||||||
|
|
||||||
autocmd FileType tex call TexHook()
|
|
||||||
|
|
||||||
function TexHook()
|
|
||||||
setlocal tabstop=2
|
|
||||||
setlocal shiftwidth=2
|
|
||||||
setlocal softtabstop=2
|
|
||||||
" setlocal foldmethod=marker
|
|
||||||
" Make a pdf
|
|
||||||
noremap <C-c> :!pdflatex -shell-escape '%'<CR><CR>
|
|
||||||
noremap <C-i> :!rifle '%:p:r.pdf'<CR><CR>
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Markdown {{{
|
|
||||||
" ------------------------------------------------------------------ "
|
|
||||||
|
|
||||||
autocmd Filetype markdown call MarkdownHook()
|
|
||||||
|
|
||||||
function MarkdownHook()
|
|
||||||
" Making and showing html
|
|
||||||
noremap <C-c> :!markdown '%:p' > '%:p:r.html'<CR><CR>
|
|
||||||
noremap <C-i> :!rifle '%:p:r.html'<CR><CR>
|
|
||||||
setlocal textwidth=0
|
|
||||||
setlocal wrapmargin=0
|
|
||||||
setlocal colorcolumn=0
|
|
||||||
setlocal wrap
|
|
||||||
setlocal linebreak
|
|
||||||
setlocal nolist
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" Python {{{
|
|
||||||
" ------------------------------------------------------------------ "
|
|
||||||
|
|
||||||
autocmd FileType python call PythonHook()
|
|
||||||
|
|
||||||
function Pylint()
|
|
||||||
silent !pylint --reports=n --output-format=parseable '%' > errors.err 2> /dev/null
|
|
||||||
cfile
|
|
||||||
silent !rm errors.err
|
|
||||||
redraw!
|
|
||||||
copen
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function PythonFold(lnum)
|
|
||||||
if getline(a:lnum-1) =~ '^\s*def\s' || getline(a:lnum-1) =~ '^\s*class\s'
|
|
||||||
return indent(a:lnum-1) / 4 + 1
|
|
||||||
endif
|
|
||||||
if getline(a:lnum) =~ '^\s*def\s' || getline(a:lnum) =~ '^\s*class\s'
|
|
||||||
return indent(a:lnum) / 4
|
|
||||||
endif
|
|
||||||
if getline(a:lnum+1) =~ '^\s*def\s' || getline(a:lnum+1) =~ '^\s*class\s'
|
|
||||||
return indent(a:lnum + 1) / 4
|
|
||||||
endif
|
|
||||||
if getline(a:lnum+1) =~ '^\S.*$'
|
|
||||||
return '0'
|
|
||||||
endif
|
|
||||||
return '='
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function PythonFoldText()
|
|
||||||
return repeat(' ', indent(v:foldstart - 1) + 4) . '+'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function PythonHook()
|
|
||||||
set formatoptions+=rq
|
|
||||||
noremap <C-i> :!python -i '%'<CR><CR>
|
|
||||||
noremap <C-x> :call Pylint()<CR>
|
|
||||||
" Uncomment to fold. Slows down SuperTab extremely
|
|
||||||
set foldmethod=expr
|
|
||||||
set foldexpr=PythonFold(v:lnum)
|
|
||||||
set foldtext=PythonFoldText()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
|
@ -1 +0,0 @@
|
|||||||
../config/nvim/ycm_extra_conf.py
|
|
Loading…
Reference in New Issue
Block a user