Skip to content

Commit

Permalink
chore(refacto): improve docs and build folder handling
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesGueunet committed Sep 20, 2019
1 parent 7f5b1a1 commit 29d53a6
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 157 deletions.
4 changes: 2 additions & 2 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ endif

" Leader key
if !exists('g:mapleader')
let g:mapleader=',' " Leader key is `,`.
let g:mapleader=',' " Leader key is `,`.
endif

" Basics configuration of the editor (file, search, completion, cursor, ...)
Expand All @@ -92,7 +92,7 @@ execute 'source '.g:Vimmic_CONFIG.'shortcuts.vim'

"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
set nocompatible " Be iMproved
endif

execute 'set runtimepath^='.g:Vimmic_DEIN
Expand Down
89 changes: 42 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ Dependencies listed here are recommended but not required for all plugins:
* **flake8** is used by the plugin for Python
**flake8-vim**. Install it through **pip**:
`pip install --user flake8`.
* **clangd** is used for C/CPP completion and **clangcheck**
is the default linter.
* **yarn** is used for the asyncronous completion

### Install and update

Expand Down Expand Up @@ -193,64 +192,60 @@ __Plugins__

Plugins and configurations included by default (lots of them are lazily/conditionally loaded):

['Shougo/dein.vim'](https://github.com/Shougo/dein.vim)
['scrooloose/nerdtree'](https://github.com/scrooloose/nerdtree)
['liuchengxu/vista.vim'](https://github.com/liuchengxu/vista.vim)
['kshenoy/vim-signature'](https://github.com/kshenoy/vim-signature)
['mbbill/undotree'](https://github.com/mbbill/undotree)
['mhinz/vim-startify'](https://github.com/mhinz/vim-startify)
['myusuf3/numbers.vim'](https://github.com/myusuf3/numbers.vim)
['junegunn/vim-peekaboo'](https://github.com/junegunn/vim-peekaboo)
['CharlesGueunet/quickmenu.vim'](https://github.com/CharlesGueunet/quickmenu.vim)
['tpope/vim-dispatch'](https://github.com/tpope/vim-dispatch)
['andymass/vim-tradewinds'](https://github.com/andymass/vim-tradewinds)
['t9md/vim-choosewin'](https://github.com/t9md/vim-choosewin)
['simeji/winresizer'](https://github.com/simeji/winresizer)
['airblade/vim-gitgutter'](https://github.com/airblade/vim-gitgutter)
['zivyangll/git-blame.vim'](https://github.com/zivyangll/git-blame.vim)
['tpope/vim-fugitive'](https://github.com/tpope/vim-fugitive)
['rhysd/committia.vim'](https://github.com/rhysd/committia.vim)
['machakann/vim-highlightedyank'](https://github.com/machakann/vim-highlightedyank)
['inkarkat/vim-mark'](https://github.com/inkarkat/vim-mark)
['luochen1990/rainbow'](https://github.com/luochen1990/rainbow)
['Raimondi/delimitMate'](https://github.com/Raimondi/delimitMate)
['kana/vim-textobj-user'](https://github.com/kana/vim-textobj-user)
['sgur/vim-textobj-parameter'](https://github.com/sgur/vim-textobj-parameter)
['glts/vim-textobj-comment'](https://github.com/glts/vim-textobj-comment)
['kana/vim-textobj-indent'](https://github.com/kana/vim-textobj-indent)
['kana/vim-textobj-entire'](https://github.com/kana/vim-textobj-entire)
['tpope/vim-commentary'](https://github.com/tpope/vim-commentary)
['tpope/vim-surround'](https://github.com/tpope/vim-surround)
['andymass/vim-matchup'](https://github.com/andymass/vim-matchup)
['kana/vim-textobj-indent'](https://github.com/kana/vim-textobj-indent)
['sgur/vim-textobj-parameter'](https://github.com/sgur/vim-textobj-parameter)
['w0rp/ale'](https://github.com/w0rp/ale)
['AndrewRadev/switch.vim'](https://github.com/AndrewRadev/switch.vim)
['ctrlpvim/ctrlp.vim'](https://github.com/ctrlpvim/ctrlp.vim)
['Lokaltog/vim-easymotion'](https://github.com/Lokaltog/vim-easymotion)
['markonm/traces.vim'](https://github.com/markonm/traces.vim)
['google/vim-searchindex'](https://github.com/google/vim-searchindex)
['mbbill/undotree'](https://github.com/mbbill/undotree)
['scrooloose/nerdtree'](https://github.com/scrooloose/nerdtree)
['CharlesGueunet/quickmenu.vim'](https://github.com/CharlesGueunet/quickmenu.vim)
['Lokaltog/vim-easymotion'](https://github.com/Lokaltog/vim-easymotion)
['Raimondi/delimitMate'](https://github.com/Raimondi/delimitMate)
['Shougo/dein.vim'](https://github.com/Shougo/dein.vim)
['SirVer/ultisnips'](https://github.com/SirVer/ultisnips)
['airblade/vim-gitgutter'](https://github.com/airblade/vim-gitgutter)
['andymass/vim-matchup'](https://github.com/andymass/vim-matchup)
['andymass/vim-tradewinds'](https://github.com/andymass/vim-tradewinds)
['eugen0329/vim-esearch'](https://github.com/eugen0329/vim-esearch)
['tommcdo/vim-lion'](https://github.com/tommcdo/vim-lion)
['AndrewRadev/switch.vim'](https://github.com/AndrewRadev/switch.vim)
['google/vim-searchindex'](https://github.com/google/vim-searchindex)
['honza/vim-snippets'](https://github.com/honza/vim-snippets)
['inkarkat/vim-ingo-library'](https://github.com/inkarkat/vim-ingo-library)
['inkarkat/vim-mark'](https://github.com/inkarkat/vim-mark)
['joereynolds/place.vim'](https://github.com/joereynolds/place.vim)
['vim-scripts/YankRing.vim'](https://github.com/vim-scripts/YankRing.vim)
['tommcdo/vim-exchange'](https://github.com/tommcdo/vim-exchange)
['junegunn/vim-peekaboo'](https://github.com/junegunn/vim-peekaboo)
['kana/vim-textobj-user'](https://github.com/kana/vim-textobj-user)
['kshenoy/vim-signature'](https://github.com/kshenoy/vim-signature)
['liuchengxu/vista.vim'](https://github.com/liuchengxu/vista.vim)
['luochen1990/rainbow'](https://github.com/luochen1990/rainbow)
['machakann/vim-highlightedyank'](https://github.com/machakann/vim-highlightedyank)
['mhinz/vim-startify'](https://github.com/mhinz/vim-startify)
['myusuf3/numbers.vim'](https://github.com/myusuf3/numbers.vim)
['neoclide/coc.nvim'](https://github.com/neoclide/coc.nvim)
['w0rp/ale'](https://github.com/w0rp/ale)
['rhysd/committia.vim'](https://github.com/rhysd/committia.vim)
['simeji/winresizer'](https://github.com/simeji/winresizer)
['t9md/vim-choosewin'](https://github.com/t9md/vim-choosewin)
['tommcdo/vim-exchange'](https://github.com/tommcdo/vim-exchange)
['tommcdo/vim-lion'](https://github.com/tommcdo/vim-lion)
['tpope/vim-commentary'](https://github.com/tpope/vim-commentary)
['tpope/vim-dispatch'](https://github.com/tpope/vim-dispatch)
['tpope/vim-fugitive'](https://github.com/tpope/vim-fugitive)
['tpope/vim-repeat'](https://github.com/tpope/vim-repeat)
['SirVer/ultisnips'](https://github.com/SirVer/ultisnips)
['honza/vim-snippets'](https://github.com/honza/vim-snippets)
['inkarkat/vim-ingo-library'](https://github.com/inkarkat/vim-ingo-library)
['tpope/vim-surround'](https://github.com/tpope/vim-surround)
['vim-scripts/YankRing.vim'](https://github.com/vim-scripts/YankRing.vim)
['zivyangll/git-blame.vim'](https://github.com/zivyangll/git-blame.vim)
['ilyachur/cmake4vim'](https://github.com/ilyachur/cmake4vim)
['lervag/vimtex'](https://github.com/lervag/vimtex)
['nickhutchinson/vim-cmake-syntax'](https://github.com/nickhutchinson/vim-cmake-syntax)
['octol/vim-cpp-enhanced-highlight'](https://github.com/octol/vim-cpp-enhanced-highlight)
['neoclide/coc-python'](https://github.com/neoclide/coc-python)
['fatih/vim-go'](https://github.com/fatih/vim-go)
['plasticboy/vim-markdown'](https://github.com/plasticboy/vim-markdown)
['prettier/vim-prettier'](https://github.com/prettier/vim-prettier)
['richq/vim-cmake-completion'](https://github.com/richq/vim-cmake-completion)
['sukima/xmledit'](https://github.com/sukima/xmledit)
['lervag/vimtex'](https://github.com/lervag/vimtex)
['neoclide/coc-vimtex'](https://github.com/neoclide/coc-vimtex)
['plasticboy/vim-markdown'](https://github.com/plasticboy/vim-markdown)
['cespare/vim-toml'](https://github.com/cespare/vim-toml)
['richq/vim-cmake-completion'](https://github.com/richq/vim-cmake-completion)
['nickhutchinson/vim-cmake-syntax'](https://github.com/nickhutchinson/vim-cmake-syntax)


__Copyright__
-------------
Expand Down
4 changes: 2 additions & 2 deletions config/editor.vim
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ set confirm " dialog foor unsaved changes
set splitright " got to right pane by default (Needed for quickmenu)
set noequalalways " do not resize when a window is closed
set notagrelative " absolute path for catgs (usefull when .git/tags)
set tags+=./.tags
set tags ^=./.git/tags
set tags^=./.tags " find ctags in the project (see the git folder in my dotfiles)
set tags^=./.git/tags

" Terminal/GUI setup
scriptencoding utf-8 " Fix encoding
Expand Down
6 changes: 4 additions & 2 deletions config/functions.vim
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ function! s:vimmic_link_compile_commands()
return
endif

if !filereadable('./compile_commands.json') && filereadable('./build/compile_commands.json')
let g:Vimmic_BUILD_DIR = get(g:, 'Vimmic_BUILD_DIR', './build/')

if !filereadable('./compile_commands.json') && filereadable(g:Vimmic_BUILD_DIR.'compile_commands.json')
echom "Create symlink to compile_commands.json ..."
silent !ln -sn ./build/compile_commands.json compile_commands.json
silent exec '!ln -sn '.g:Vimmic_BUILD_DIR.'compile_commands.json compile_commands.json'
endif
endfunction

Expand Down
4 changes: 2 additions & 2 deletions config/plugins/Ale.vim
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ if s:loaded == 0
augroup vimmic_c_ale_config
autocmd!
autocmd FileType c let g:ale_linters = {'c':['clangcheck', 'cpplint']}
autocmd FileType cpp let g:ale_c_build_dir_names = ['.', 'build']
autocmd FileType cpp let g:ale_c_build_dir_names = ['.', g:Vimmic_BUILD_DIR]
augroup end

augroup vimmic_cpp_ale_config
autocmd!
autocmd FileType cpp let g:ale_linters = {'cpp':['clangcheck', 'cppcheck', 'cpplint']}
autocmd FileType cpp let g:ale_c_build_dir_names = ['.', 'build']
autocmd FileType cpp let g:ale_c_build_dir_names = ['.', g:Vimmic_BUILD_DIR]
augroup end

augroup vimmic_py_config
Expand Down
97 changes: 37 additions & 60 deletions extra/vimrc.postconf.sample
Original file line number Diff line number Diff line change
@@ -1,82 +1,59 @@
" This file is given as a sample file.
" You might copy it but avoid symbolic link.
" color fix
"autocmd VimEnter,ColorScheme * highlight SignColumn ctermbg=233
" autocmd VimEnter,ColorScheme * highlight IncSearch ctermfg=DarkRed ctermbg=NONE cterm=bold
"autocmd VimEnter,ColorScheme * highlight Search ctermfg=Yellow ctermbg=NONE cterm=bold
"autocmd VimEnter,ColorScheme * highlight clear VertSplit
"autocmd VimEnter,ColorScheme * highlight clear SignColumn
"autocmd VimEnter,ColorScheme * highlight clear LineNr
"autocmd VimEnter,ColorScheme * highlight Visual ctermbg=234 ctermfg=gray cterm=bold

"""""""""""""""""""""""""""""
" Colorscheme and Theme
"""""""""""""""""""""""""""""

" Adapt some color to the new theme
augroup highlight_clear_enter
autocmd VimEnter * highlight clear VertSplit
autocmd VimEnter * highlight clear SignColumn
autocmd VimEnter * highlight clear LineNr
" Use bakground of your term
autocmd VimEnter * highlight Normal ctermbg=NONE
augroup END

" Colorscheme used (no termguicolors)
" colorscheme gruvbox

" Colorscheme for true colors
" set background=dark
"" set termguicolors " if not already in preconf
" colorscheme quantum

" if !has("nvim")
" if !has('nvim')
" set term=xterm-256color
" endif

""""""""""""""""""""""""""""""""""""
" Feature
""""""""""""""""""""""""""""""""""""
" avoid completion on these files
" set wildignore+=*/build/*,*/buildD/*,*/buildR/*
"
" Avoid boost completion (too long)
" autocmd FileType c,cpp set include=^\\s*#\\s*include\ \\(<boost/\\)\\@!

" all .swp in a folder
" you need to create this folder
" The trailing // allows to use the complete path of the
" saved file to ensure uniqueness
" execute 'set directory='.g:Vimmic_BASE.'/.swapfiles//'
" or
" set directory=$HOME/.cache/vimtmp//
" Undo tree
"autocmd VimEnter,ColorScheme * highlight UndotreeBranch ctermfg=blue
"autocmd VimEnter,ColorScheme * highlight UndotreeCurrent ctermfg=yellow
"autocmd VimEnter,ColorScheme * highlight UndotreeFirstNode ctermfg=blue

""""""""""""""""""""""""""""""
" personal stuff
""""""""""""""""""""""""""""""
" Add custom

" Fix typo
inoremap fasle false
" nmap XX :q!<cr>

" Code facilities for qwerty
augroup cpp_replace
autocmd FileType c,cpp inoremap -. ->
autocmd FileType c,cpp inoremap <, <<
augroup END
" inoremap fasle false

" Get rid of command window
" map q: :q
" au FileType c,cpp inoremap -, ->

" augroup latex_spell
" autocmd FileType tex set spell spelllang=en
" spell for latex
" autocmd FileType tex set spell spelllang=en

" no terminal in bufer (not for nvim)
" augroup termIgnore
" autocmd!
" autocmd TerminalOpen * set nobuflisted
" augroup END

""""""""""""""""""""""""""""""
" Plugins configuration
""""""""""""""""""""""""""""""
" in insert mode, j + direction for action
" imap jh <Backspace>
" imap jj <Esc>o
" imap jk <Esc>O
" imap jl <Esc>
" imap j; <Esc>gi$;i


" Asynchronous linter triggers:
" let g:ale_lint_on_text_changed = 0
" let g:ale_lint_on_enter = 0
" let g:ale_lint_on_save = 0
"""""""""""""""""" GitGutter

" Beautiful git marker
" let g:gitgutter_sign_added = '│'
" let g:gitgutter_sign_modified = '│'
" let g:gitgutter_sign_removed = '│'
" let g:gitgutter_sign_removed_first_line = '.'
" let g:gitgutter_sign_modified_removed = '├'

""""""""""""""""""""""""""""""
" Filetype custom
""""""""""""""""""""""""""""""

" Prevent vim to scan the whole boost library for completion
" autocmd FileType c,cpp set include=^\\s*#\\s*include\ \\(<boost/\\)\\@!
Loading

0 comments on commit 29d53a6

Please sign in to comment.