Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
0d9d35b
use <leader>1,<leader>2 fff for easy airline buffer selection. Added …
beckenc Mar 23, 2020
56a8aaa
removed non working enhanced highlighting plugin
Mar 23, 2020
3f8bcfc
Source .virmc after writing
Mar 24, 2020
e69af40
added <leader>c to ease buffer closing. Prevent fzf to open buffers i…
Mar 24, 2020
3bd31ee
Merge branch 'gambels-master' into devel
Mar 24, 2020
bd6903e
use @gambels leader semantic
Mar 24, 2020
7c611e2
Support window command also in INSERT mode
Mar 24, 2020
9774a71
Always show signcolumn
beckenc Mar 28, 2020
a670799
added ,gt (YCM GetType) and ,gd (YCM GetDoc) to the keymap
beckenc Mar 28, 2020
8fc027f
adjust YCM settings. Complete in strings to get suggestions in includ…
beckenc Mar 28, 2020
f38bffe
added clang-format plugin and dmde format style setting
beckenc Mar 28, 2020
e975c00
adjust formatting settings. Autodetect .clang-format / _clang-format
beckenc Mar 29, 2020
1c45555
fixed typo
beckenc Mar 29, 2020
e565f8c
allow short functions to be in a single line
Mar 29, 2020
e86ecb3
Do not split empty Functions, Records and Namespaces
Mar 29, 2020
26ccdee
Update README.md
beckenc Apr 3, 2020
fa1daa2
* fixed isdirectory call that didn't work
Apr 20, 2020
a6b0cf5
Merge branch 'devel' of https://github.com/beckenc/vim-ide into devel
Apr 20, 2020
d028fe5
set 0700 permissions for directories
Apr 20, 2020
efd048d
check for python support in vim before installing YouCompleteMe
beckenc May 8, 2020
a2181d8
removed accidently commented ycm configuration
beckenc May 8, 2020
df2e095
corrected python support check for minpac
beckenc May 11, 2020
c860579
use <Enter> to stop completion, turn off th indentifier completer (ju…
Jul 21, 2020
8a91c48
disable arrow keys
Jul 30, 2020
00bd46d
use vim the hard way
Jul 30, 2020
7ae8611
source hard_ass.vim
Jul 30, 2020
b69ea5d
added gentoo/gentoo-syntax plugin
Sep 16, 2020
5800c80
allow arrows in insert mode
Sep 18, 2020
bcc5d66
updated minpac
Oct 7, 2020
a61e89f
merge with devel
Oct 7, 2020
01d4d1f
catch installation errors if minpack is not installed
Oct 7, 2020
e1a4289
be more verbosive during installation
Oct 7, 2020
30d803b
Improved error handling for plugin loading
Oct 7, 2020
e82cb94
fixed plugin options
beckenc Oct 7, 2020
33cdf4e
fixed return value of the installer in cals of PackInstall fails
beckenc Oct 7, 2020
3b6a3cd
Move SpliX Options into the BraceWrapping Section
Oct 13, 2020
0658cc2
Do not delete training whitespaces for all filetypes (.patch need whi…
Oct 13, 2020
571ade0
update submodules
Oct 14, 2020
b3d5e51
added vim-bitbake plugin
Oct 19, 2020
b0d3e52
Update README.md
beckenc Jan 14, 2021
f74542f
Merge branch 'master' into devel
Jan 14, 2021
21ecdca
merged master
Jan 14, 2021
51be169
Merge branch 'master' into devel
Jan 14, 2021
0386392
merged master
Jan 14, 2021
df5c637
workaround for windows terminal to render backround correctly
Jan 14, 2021
85f9553
integrate vimtmux
beckenc Jan 14, 2021
2ca9590
take fzf from system or ask for download
Jan 15, 2021
95b2635
change fzf command to CTRL-T. Align with bash
Jan 15, 2021
cb5acce
window navigation with hjkl
Jan 15, 2021
d8d2aa6
load airline only if symbols are there
Jun 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Install vim-ide
```bash
git clone --recurse-submodules https://github.com/nuccleon/vim-ide.git
git clone --recurse-submodules https://github.com/beckenc/vim-ide.git
```

### .. for current user
Expand Down Expand Up @@ -37,4 +37,5 @@ git clone --recurse-submodules https://github.com/nuccleon/vim-ide.git

* https://devhints.io/vimscript
* https://learnvimscriptthehardway.stevelosh.com
* https://docs.microsoft.com/de-de/windows/terminal/tutorials/powerline-setup

13 changes: 11 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -ue
set -u


DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
Expand Down Expand Up @@ -29,6 +29,7 @@ let \$MYVIMRCPATH = "$DIR/vimrc"

let vimrc_misc = 1
let vimrc_keymap = 1
let vimrc_hard_ass = 1
let vimrc_functions = 1
let vimrc_commands = 1
let vimrc_filetypes = 1
Expand All @@ -46,6 +47,10 @@ if 1 == vimrc_keymap
so $DIR/vimrc/keymap.vim
endif

if 1 == vimrc_hard_ass
so $DIR/vimrc/hard_ass.vim
endif

if 1 == vimrc_functions
so $DIR/vimrc/functions.vim
endif
Expand Down Expand Up @@ -84,8 +89,12 @@ done

echo "Update plugins .."
vim -N -u "$DIR"/vimrc/plugins.vim -c "set packpath^=$DIR" -c "PackInstall"
if [ $? -ne 0 ]; then
echo "PackInstall failed. Minpack installed? (see README.md)"
exit 1
fi
echo "Update helptags .."
vim -N -u "$DIR"/vimrc/plugins.vim -c "silent! helptags ALL" -c "quit!"
vim -N -u "$DIR"/vimrc/plugins.vim -c "silent! helptags ALL" -c "quitall!"

exit 0

Expand Down
2 changes: 1 addition & 1 deletion vimrc/commands.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ command QuickFixToggle call QuickFixToggle()
" :W sudo saves the file
" (useful for handling the permission-denied error)
" command! W execute 'w !sudo tee % > /dev/null' <bar> edit!
"command! W w !sudo tee "%" > /dev/null
command! W w !sudo tee "%" > /dev/null
9 changes: 6 additions & 3 deletions vimrc/filetypes.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ augroup filetype_generic
autocmd!

" Automatically remove all trailing spaces for all file types
autocmd BufWritePre * :call TrimWhiteSpace()
"autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.md,*.cpp,*.h,*.hpp,*.c,*.mk,*.vim :call TrimWhiteSpace()
" autocmd BufWritePre * :call TrimWhiteSpace()
autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.md,*.cpp,*.h,*.hpp,*.c,*.mk,*.vim :call TrimWhiteSpace()

" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
Expand All @@ -17,6 +17,9 @@ augroup filetype_generic
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif

" Re-source .vimrc on saving
autocmd! BufWritePost $MYVIMRCPATH/*.vim source ~/.vimrc
augroup END

augroup filetype_vim
Expand All @@ -33,7 +36,7 @@ augroup END
augroup filetype_cpp
autocmd!
autocmd FileType cpp setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType cpp setlocal filetype=cpp.doxygen
autocmd FileType cpp setlocal filetype=cpp
autocmd FileType cpp setlocal spelllang=en
augroup END

Expand Down
13 changes: 13 additions & 0 deletions vimrc/hard_ass.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

" File: hard_ass.vim
" Descritpion: source this, to use vim the hard way
" =============================================================================

" =============================================================================
" Section: Disable arrow keys for navigation
" =============================================================================
for key in ['<Up>', '<Down>', '<Left>', '<Right>']
exec 'noremap' key '<Nop>'
" exec 'inoremap' key '<Nop>'
exec 'cnoremap' key '<Nop>'
endfor
43 changes: 34 additions & 9 deletions vimrc/keymap.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
" =============================================================================

" File: keymap.vim
" Descritpion: Keymap configuration
" =============================================================================
Expand Down Expand Up @@ -73,21 +73,42 @@ nnoremap tm :tabm<CR>
nnoremap tt :tabnew<CR>
nnoremap to :tabonly!<CR>

nnoremap <C-t> :tabnew<CR>
nnoremap <C-w> :confirm bdelete<CR>
"nnoremap <C-t> :tabnew<CR>
nnoremap <C-w> :confirm bdelete<CR>:tabclose<CR>gT

" Open tag under cursor in new tab
"noremap <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>

nmap <Leader>1 <Plug>AirlineSelectTab1
nmap <Leader>2 <Plug>AirlineSelectTab2
nmap <Leader>3 <Plug>AirlineSelectTab3
nmap <Leader>4 <Plug>AirlineSelectTab4
nmap <Leader>5 <Plug>AirlineSelectTab5
nmap <Leader>6 <Plug>AirlineSelectTab6
nmap <Leader>7 <Plug>AirlineSelectTab7
nmap <Leader>8 <Plug>AirlineSelectTab8
nmap <Leader>9 <Plug>AirlineSelectTab9

" =============================================================================
" Section: Buffer navigation
" =============================================================================
nnoremap <Leader>n :bnext<CR>
nnoremap <Leader>p :bprevious<CR>
nnoremap <Leader>c :confirm bdelete<CR>:tabclose<CR>gT

" =============================================================================
" Section: Window navigation
" =============================================================================

" Select window with Alt- Up/Down/Let/Right
nnoremap <silent> <A-Up> :wincmd k<CR>
nnoremap <silent> <A-Down> :wincmd j<CR>
nnoremap <silent> <A-Left> :wincmd h<CR>
nnoremap <silent> <A-Right> :wincmd l<CR>
" Select window with Alt- Up/Down/Left/Right
nnoremap <silent> <Leader>k :wincmd k<CR>
inoremap <silent> <Leader>k <ESC> :wincmd k<CR>i
nnoremap <silent> <Leader>j :wincmd j<CR>
inoremap <silent> <Leader>j <ESC> :wincmd j<CR>i
nnoremap <silent> <Leader>h :wincmd h<CR>
inoremap <silent> <Leader>h <ESC> :wincmd h<CR>i
nnoremap <silent> <Leader>l :wincmd l<CR>
inoremap <silent> <Leader>l <ESC> :wincmd l<CR>i

" Split window with Leader - and |
noremap <silent> <Leader>- :split<CR>
Expand All @@ -104,9 +125,13 @@ inoremap <silent> <A-F11> <C-O><A-F11>
nnoremap <F3> :YcmCompleter GoTo<CR>
nnoremap <F4> :YcmCompleter GoToReferences<CR>
nnoremap <F5> :YcmForceCompileAndDiagnostics<CR>
nnoremap <Leader>gt :YcmCompleter GetType<CR>
nnoremap <Leader>gd :YcmCompleter GetDoc<CR>

" Look for files under current directory
nnoremap <C-p> :<C-u>FZF<CR>
nnoremap <C-t> :<C-u>FZF<CR>
" prevent opening FZF search result in NERD Tree
nnoremap <silent> <expr> <C-t> (expand('%') =~ 'NERD_tree' ? "\<c-w>\<c-w>" : "").":FZF\<CR>"

" =============================================================================
" Section: Formatting
Expand Down
17 changes: 11 additions & 6 deletions vimrc/misc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ set hlsearch
" =============================================================================

" Set swap directory
if !isdirectory("~/.vim/swap")
silent !mkdir -p ~/.vim/swap
if !isdirectory($HOME."/.vim/swap")
call mkdir($HOME."/.vim/swap", "p", 0700)
endif
set directory=~/.vim/swap

" Set backup directory
if !isdirectory("~/.vim/backup")
silent !mkdir -p ~/.vim/backup
if !isdirectory($HOME."/.vim/backup")
call mkdir($HOME."/.vim/backup", "p", 0700)
endif
set backupdir=~/.vim/backup
set backup

" Set undo directory
if !isdirectory("~/.vim/undo")
silent !mkdir -p ~/.vim/undo
if !isdirectory($HOME."/.vim/undo")
call mkdir($HOME."/.vim/undo", "p", 0700)
endif
set undodir=~/.vim/undo
set undofile
Expand Down Expand Up @@ -134,6 +134,9 @@ set noshowmode
" Always show tabline
set showtabline=2

" Always show signcolumn
set signcolumn=yes

" Set utf8 as standard encoding
set encoding=utf8

Expand All @@ -150,6 +153,8 @@ else
colorscheme wombat
endif
set background=dark
" WSL workaround, google: VIM backround colors render incorrectly
set t_ut=

if has('gui_running')
set t_Co=256
Expand Down
92 changes: 76 additions & 16 deletions vimrc/plugins.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,27 @@
" Section: Minimal package manager
" =============================================================================

function! PackInit() abort
function! PackInit(verbose_level) abort
packadd minpac

if exists('*minpac#init')
if !exists('g:loaded_minpac')
" minpac is not available.
" Settings for plugin-less environment
echoerr "minpac is not available"
cq 1
else
" Initialize minpac
call minpac#init({'verbose': '3'})
call minpac#init({'verbose': a:verbose_level, 'status_auto': 'TRUE', 'progress_open': 'vertical', 'status_open': 'vertical'})

" Minimal package manager
call minpac#add('k-takata/minpac', {'type': 'opt'})
" A tree explorer plugin for vim.
call minpac#add('scrooloose/nerdtree')
" Syntax checking hacks for vim.
call minpac#add('scrooloose/syntastic')
" A command-line fuzzy finder
call minpac#add('junegunn/fzf',{'do': 'call fzf#install()'})
" A command-line fuzzy finder (pickup fzf binary available on the system. If it is not found in $PATH,
" it will ask if it should download the latest binary
call minpac#add('junegunn/fzf')
" lean & mean status/tabline for vim that's light as air
call minpac#add('vim-airline/vim-airline')
call minpac#add('vim-airline/vim-airline-themes')
Expand All @@ -36,26 +42,38 @@ function! PackInit() abort
" A class outline viewer for Vim
call minpac#add('majutsushi/tagbar')
" A code-completion engine for Vim
call minpac#add('ycm-core/YouCompleteMe',{'do': {-> system('./install.py --clangd-completer')}})
if has('python3')
call minpac#add('ycm-core/YouCompleteMe',{'do': {-> system('./install.py --clangd-completer')}})
else
echomsg "YouCompleteMe needs vim compiled with python support"
endif
" Vim plugin for clang-format, a formatter for C, C++, Obj-C, Java, JavaScript, TypeScript and ProtoBuf.
call minpac#add('rhysd/vim-clang-format')
" Cosmetics
call minpac#add('vim-scripts/Wombat')
call minpac#add('vim-scripts/wombat256.vim')
else
echoerr "minpac is not available"
cq
" Template
call minpac#add('gentoo/gentoo-syntax')
call minpac#add('kergoth/vim-bitbake')
call minpac#add('edkolev/tmuxline.vim')
endif

endfunction

" =============================================================================
" Section: edkolev/tmuxline.vim
" =============================================================================
let g:airline#extensions#tmuxline#enabled = 0

" =============================================================================
" Section: k-takata/minpac
" =============================================================================

" Define minpac user commands
command! PackUpdate call PackInit() | call minpac#update('', {'do': 'call minpac#status()'})
command! PackClean call PackInit() | call minpac#clean()
command! PackStatus call PackInit() | call minpac#status()
command! PackInstall call PackInit() | call minpac#update('', {'do': 'quit'})
command! PackUpdate call PackInit(4) | call minpac#update()
command! PackClean call PackInit(3) | call minpac#clean()
command! PackStatus call PackInit(3) | call minpac#status()
command! PackInstall call PackInit(4) | call minpac#update('', {'do': 'quitall!'})

" =============================================================================
" Section: scrooloose/nerdtree
Expand All @@ -80,6 +98,7 @@ let g:syntastic_check_on_wq = 0
" =============================================================================
" Section: junegunn/fzf
" =============================================================================
let g:fzf_layout = { 'down': '30%' }

" =============================================================================
" Section: majutsushi/tagbar
Expand All @@ -91,17 +110,58 @@ let g:syntastic_check_on_wq = 0
" =============================================================================
" Section: ycm-core/YouCompleteMe
" =============================================================================
let g:ycm_complete_in_comments = 0
let g:ycm_complete_in_strings = 0
let g:ycm_complete_in_comments = 1
let g:ycm_complete_in_strings = 1
let g:ycm_max_num_candidates = 10
let g:ycm_max_num_identifiers_candidates = 10
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
" want to just turn off the identifier completer but keep the semantic trigger (. or ->) active
let g:ycm_min_num_of_chars_for_completion = 99
let g:ycm_key_list_stop_completion = ['<C-y>', '<Enter>']

" =============================================================================
" Section: rhysd/vim-clang-format
" =============================================================================
" automatically detect .clang-format / _clang-format in project's root
let g:clang_format#detect_style_file = 1
" automatically format buffer on save
let g:clang_format#auto_format = 1
" If autodetect of .clang-format / _clang-romat failes, use that settings
let g:clang_format#code_style = "microsoft"
let g:clang_format#style_options = {
\ "AllowShortBlocksOnASingleLine" : "true",
\ "AllowShortCaseLabelsOnASingleLine" : "true",
\ "AllowShortFunctionsOnASingleLine" : "true",
\ "BraceWrapping" : {
\ "AfterCaseLabel" : "true",
\ "SplitEmptyFunction" : "false",
\ "SplitEmptyRecord" : "false",
\ "SplitEmptyNamespace" : "false",
\ "AfterUnion" : "true" },
\ "PointerAlignment" : "Left",
\ "BreakInheritanceList" : "BeforeComma",
\ "BreakConstructorInitializers" : "BeforeComma",
\ "CompactNamespaces" : "true",
\ "IndentCaseLabels" : "true",
\ "NamespaceIndentation" : "All",
\ "ConstructorInitializerIndentWidth" : 2,
\ "ContinuationIndentWidth" : 2,
\ "IndentWidth" : 2,
\ "TabWidth" : 2 }

" =============================================================================
" Section: vim-airline
" =============================================================================

let g:airline_powerline_fonts = 1
let g:airline_theme = 'wombat'

if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif

let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_idx_mode = 1
let g:airline_theme='wombat'
let g:airline#extensions#tabline#formatter = 'unique_tail'