Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set nocompatible
- " set up true colors
- set term=screen-256color
- if &term =~# '^screen'
- let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
- let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
- endif
- filetype off
- execute pathogen#infect()
- execute pathogen#helptags()
- syntax on
- filetype plugin on
- set omnifunc=syntaxcomplete#Complete
- " color scheme config...
- set background=dark
- colorscheme monokai
- set termguicolors
- let mapleader = " "
- nnoremap <SPACE> <Nop>
- " other vim options
- " set modelines=0
- set encoding=utf-8
- set scrolloff=3
- set autoindent
- set smartindent
- set showcmd
- set wildmenu
- set wildmode=list:longest
- set visualbell
- set cursorline
- set ttyfast
- set ruler
- set backspace=indent,eol,start
- set laststatus=2
- "set wrap
- set textwidth=79
- set formatoptions=qrn1
- set ignorecase
- set smartcase
- set gdefault
- set incsearch
- set showmatch
- set hlsearch
- set noshowmode " because Lightline already shows mode
- set clipboard=unnamed
- " Basic fzf support
- set rtp+=/usr/local/opt/fzf
- " make splits open downward and to the right
- " depending on vertical/horizontal splitting respectively.
- set splitbelow
- set splitright
- set noshowmatch
- " indent options
- set tabstop=4
- set shiftwidth=4
- set softtabstop=4
- set expandtab
- " Line numbers.
- " relative is relative to current line.
- " number is absolute numbers
- "set relativenumber
- set number
- " spellcheck
- "set spell spelllang=en_gb
- " toggle search highlights
- nnoremap <BSlash> :noh <CR>
- nnoremap j gj
- nnoremap k gk
- " SLIME-V config
- let g:slime_target="vimterminal"
- let g:slime_vimterminal_config={ "vertical": 1 }
- " PYMODE config
- let g:pymode_breakpoint=0
- let g:pymode_python="python3"
- " disable annoying remaps for paredit.vim
- let g:paredit_leader = '<leader>'
- let g:paredit_shortmaps=0
- set completeopt=longest,menuone,preview
- " change the behavior of the <Enter> key when the popup menu is visible. In that case the Enter key will simply select the highlighted menu item, just as <C-Y> does.
- inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
- " fzf bindings:
- " fzf for buffers and files respectively.
- nmap <Leader>b :Buffers<CR>
- nmap <Leader>f :Files<CR>
- " ... and hopefully respect gitignore.
- let $FZF_DEFAULT_COMMAND = 'ag -g ""'
- " Rainbow parens
- au VimEnter * RainbowParenthesesToggle
- au Syntax * RainbowParenthesesLoadRound
- au Syntax * RainbowParenthesesLoadSquare
- au Syntax * RainbowParenthesesLoadBraces
- " ALE code linting
- let g:ale_sign_column_always = 1
- let g:ale_completion_enabled = 1
- let g:ale_sign_error = 'E'
- let g:ale_sign_warning = 'W'
- let g:ale_lint_on_text_changed = 'never'
- " LIGHTLINE SETUP
- let g:lightline = {
- \ 'colorscheme': 'powerline',
- \ 'active': {
- \ 'left': [['mode', 'paste'], ['filename', 'modified']],
- \ 'right': [['linter_ok', 'linter_warnings', 'linter_errors'], ['readonly', 'lineinfo'], ['percent']]
- \ },
- \ 'component_expand': {
- \ 'linter_warnings': 'LightlineLinterWarnings',
- \ 'linter_errors': 'LightlineLinterErrors',
- \ 'linter_ok': 'LightlineLinterOK'
- \ },
- \ 'component_type': {
- \ 'readonly': 'error',
- \ 'linter_warnings': 'warning',
- \ 'linter_errors': 'error',
- \ 'linter_ok': 'ok'
- \ },
- \ }
- " Lightline settings for ALE
- " good info here: https://github.com/itchyny/lightline.vim/issues/236
- function! LightlineLinterWarnings() abort
- let l:counts = ale#statusline#Count(bufnr(''))
- let l:all_errors = l:counts.error + l:counts.style_error
- let l:all_non_errors = l:counts.total - l:all_errors
- return l:counts.total == 0 ? '' : printf('%d ▲', all_non_errors)
- endfunction
- function! LightlineLinterErrors() abort
- let l:counts = ale#statusline#Count(bufnr(''))
- let l:all_errors = l:counts.error + l:counts.style_error
- let l:all_non_errors = l:counts.total - l:all_errors
- return l:counts.total == 0 ? '' : printf('%d ✗', all_errors)
- endfunction
- function! LightlineLinterOK() abort
- let l:counts = ale#statusline#Count(bufnr(''))
- let l:all_errors = l:counts.error + l:counts.style_error
- let l:all_non_errors = l:counts.total - l:all_errors
- return l:counts.total == 0 ? '✓' : ''
- endfunction
- autocmd User ALELint call lightline#update()
- " Navigating location list
- nnoremap <Leader>n :call WrapCommand("down")<CR>
- nnoremap <Leader>p :call WrapCommand("up")<CR>
- function! WrapCommand(direction)
- if a:direction == "up"
- try
- lprevious
- catch /^Vim\%((\a\+)\)\=:E553/
- llast
- endtry
- elseif a:direction == "down"
- try
- lnext
- catch /^Vim\%((\a\+)\)\=:E553/
- lfirst
- endtry
- endif
- endfunction
- " call Piggieback for figwheel dev
- command! Pig :Piggieback (figwheel-sidecar.repl-api/repl-env)
- " vim-fireplace binds
- nnoremap <Leader>t :RunTests<CR>
- nnoremap <Leader>e :Eval<CR>
- nnoremap <Leader>E :%Eval<CR>
- nnoremap <Leader>l :Last<CR>
- nnoremap <Leader>c :clo<CR>
- nnoremap <Leader>d :bd<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement