Skip to content

Commit

Permalink
💩 Messing around with vim autocompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
albertomontesg committed Apr 1, 2018
1 parent 12c0b6c commit 8d908c7
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 16 deletions.
9 changes: 9 additions & 0 deletions editor/setup_linters.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

# Install linters for various coding languages
pip3 install -U proselint cpplint vim-vint yamllint

brew install shellcheck shfmt google-java-format

npm install -g csslint prettier stylelint eslint htmlhint markdownlint \
write-good
2 changes: 2 additions & 0 deletions editor/yapf/style
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[style]
based_on_style = google
13 changes: 11 additions & 2 deletions vim/plugin/ale.vim
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
" ----- w0rp/ale -----
" Configuration
let g:ale_lint_on_insert_leave = 1
let g:ale_completion_enabled = 1
let g:ale_fix_on_save = 1
" Define signs
let g:ale_sign_error = ''
let g:ale_sign_warning = ''
" Define fixers for different file types
let g:ale_fixers = {
\ 'bash': ['shfmt', 'remove_trailing_lines', 'trim_whitespace'],
\ 'javascript': ['prettier', 'remove_trailing_lines', 'trim_whitespace'],
\ 'json': ['prettier', 'remove_trailing_lines', 'trim_whitespace'],
\ 'python': ['isort', 'yapf', 'remove_trailing_lines', 'trim_whitespace'],
\ 'css': ['prettier', 'remove_trailing_lines', 'trim_whitespace'],
\ 'tex': ['remove_trailing_lines', 'trim_whitespace'],
\ 'html': ['remove_trailing_lines', 'trim_whitespace'],
\ 'vim': ['remove_trailing_lines', 'trim_whitespace'],
\ 'sh': ['remove_trailing_lines', 'trim_whitespace'],
\ 'sh': ['shfmt', 'remove_trailing_lines', 'trim_whitespace'],
\}

" Customize error sign
highlight clear ALEErrorSign
highlight ALEErrorSign ctermfg=1 ctermbg=18 guifg=#EC5F67 guibg=#2C393F

let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
" nnoremap <silent> ld :ALEGoToDefinition<CR>
2 changes: 2 additions & 0 deletions vim/plugin/deoplete.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
" ----- Shougo/deoplete.nvim -----
let g:deoplete#enable_at_startup = 1
9 changes: 0 additions & 9 deletions vim/plugin/nvim-completion-manager.vim
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
" ----- roxma/nvim-completion-manager -----
set shortmess+=c
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
let g:UltiSnipsExpandTrigger = '<Plug>(ultisnips_expand)'
let g:UltiSnipsJumpForwardTrigger = '<c-j>'
let g:UltiSnipsJumpBackwardTrigger = '<c-k>'
let g:UltiSnipsRemoveSelectModeMappings = 0
" optional
inoremap <silent> <c-u> <c-r>=cm#sources#ultisnips#trigger_or_popup("\<Plug>(ultisnips_expand)")<cr>
9 changes: 6 additions & 3 deletions vim/plugin/ultisnips.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
" let g:UltiSnipsExpandTrigger='<c-n>'
" let g:UltiSnipsJumpForwardTrigger = '<tab>'
" let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
let g:UltiSnipsExpandTrigger='<CR>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsJumpBackwardTrigger = '<S-tab>'

inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
25 changes: 23 additions & 2 deletions vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,35 @@
Plugin 'blueyed/vim-diminactive'

" IDE:
" LSP
" Plugin 'autozimu/LanguageClient-neovim'
" Tags
Plugin 'majutsushi/tagbar'
" Syntax linter and fix
Plugin 'w0rp/ale'
" Fuzzy Finding
Plugin 'junegunn/fzf.vim'
" Completion
" if has('nvim')
" Plugin 'roxma/nvim-completion-manager'
" endif
if has('nvim')
Plugin 'roxma/nvim-completion-manager'
Plugin 'Shougo/deoplete.nvim'
else
Plugin 'Shougo/deoplete.nvim'
Plugin 'roxma/nvim-yarp'
Plugin 'roxma/vim-hug-neovim-rpc'
endif
Plugin 'zchee/deoplete-jedi'
Plugin 'Shougo/neco-vim'
Plugin 'zchee/deoplete-go'
Plugin 'zchee/deoplete-clang'
Plugin 'Shougo/neco-syntax'
Plugin 'mhartington/nvim-typescript'
Plugin 'zchee/deoplete-zsh'
Plugin 'wellle/tmux-complete.vim'
Plugin 'lionawurscht/deoplete-biblatex'
Plugin 'fszymanski/deoplete-emoji'
" Snippets
if has('python') || has('python3')
Plugin 'SirVer/ultisnips'
Expand All @@ -61,7 +80,7 @@
" Close buffers
Plugin 'qpkorr/vim-bufkill'
" Auto save
Plugin '907th/vim-auto-save'
" Plugin '907th/vim-auto-save'
" Highlight yank text
Plugin 'machakann/vim-highlightedyank'
" Multiple cursors
Expand Down Expand Up @@ -95,6 +114,7 @@
Plugin 'roxma/ncm-clang'
" Go
Plugin 'fatih/vim-go'
Plugin 'nsf/gocode', {'rtp': 'vim/'}
" CoffeeScript
Plugin 'kchmck/vim-coffee-script'

Expand Down Expand Up @@ -142,6 +162,7 @@
" search
set incsearch
set hlsearch
set ignorecase
if has('nvim')
set inccommand=split
endif
Expand Down

0 comments on commit 8d908c7

Please sign in to comment.