Swap out several plugins and rewire hotkeys

This commit is contained in:
Fabian Becker 2021-05-18 17:09:48 +02:00
parent c9c2eca858
commit fb182d1f18
4 changed files with 106 additions and 22 deletions

View File

@ -24,20 +24,20 @@ else
set signcolumn=yes
endif
" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
" inoremap <silent><expr> <TAB>
" \ pumvisible() ? "\<C-n>" :
" \ <SID>check_back_space() ? "\<TAB>" :
" \ coc#refresh()
" inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()

View File

@ -86,13 +86,25 @@ if !exists('g:vscode')
" list and select buffer
nnoremap <silent> <leader>bg :ls<CR>:buffer<Space>
" TELESCOPE
" Find files using Telescope command-line sugar.
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
" Maps display of current buffers
nnoremap <C-b> <cmd>Telescope buffers<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" Telescope project
nnoremap <silent> <leader>fp :Telescope project<CR>
" Start terminal in insert mode
au BufEnter * if &buftype == 'terminal' | :startinsert | endif
nnoremap <silent> <leader>tt :terminal<CR>
nnoremap <silent> <leader>tv :vnew<CR>:terminal<CR>
nnoremap <silent> <leader>th :new<CR>:terminal<CR>
tnoremap <C-x> <C-\><C-n><C-w>q
" au BufEnter * if &buftype == 'terminal' | :startinsert | endif
" nnoremap <silent> <leader>tt :terminal<CR>
" nnoremap <silent> <leader>tv :vnew<CR>:terminal<CR>
" nnoremap <silent> <leader>th :new<CR>:terminal<CR>
" tnoremap <C-x> <C-\><C-n><C-w>q
let s:hidden_all = 0
@ -119,5 +131,30 @@ if !exists('g:vscode')
endif
endfunction
nnoremap <silent> <leader>h :call ToggleHiddenAll()<CR>
" nnoremap <silent> <leader>h :call ToggleHiddenAll()<CR>
nnoremap <silent> <F9> :FloatermNew --height=0.4 --width=0.98 --wintype=floating --position=bottom --autoclose=2 --title=
tnoremap <silent> <F9> <C-\><C-n>:FloatermNew --height=0.4 --width=0.98 --wintype=floating --position=bottom --autoclose=2 --title=
nnoremap <silent> <F8> :FloatermPrev<CR>
tnoremap <silent> <F8> <C-\><C-n>:FloatermPrev<CR>
nnoremap <silent> <F10> :FloatermNext<CR>
tnoremap <silent> <F10> <C-\><C-n>:FloatermNext<CR>
inoremap <silent> <F11> <C-c>:FloatermToggle<CR>
nnoremap <silent> <F11> :FloatermToggle<CR>
tnoremap <silent> <F11> <C-\><C-n>:FloatermToggle<CR>
tnoremap <silent> <M-o> <C-\><C-n><CR>
nnoremap <C-c><C-c> :FloatermSend<CR>
vnoremap <C-c><C-c> :FloatermSend<CR>
" Automatic formatting for Julia files
autocmd FileType julia nnoremap <buffer> <c-f> :JuliaFormatterFormat<cr>
" Maps quit
noremap <leader>q :q<cr>
" Maps quit all
noremap <c-q> :qa<cr>
" Maps write
nnoremap <leader>w :w<cr>
end

View File

@ -12,6 +12,9 @@ set relativenumber
set scrolloff=8
set termguicolors
" Set tabstop and shiftwidth to 4 spaces
set expandtab ts=4 sw=4 ai
" hide mode as it's shown in lightline
set noshowmode

View File

@ -2,21 +2,21 @@
call plug#begin()
Plug 'airblade/vim-gitgutter'
Plug 'andymass/vim-matchup'
" Plug 'andymass/vim-matchup'
Plug 'editorconfig/editorconfig-vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'junegunn/vim-easy-align'
" Multiple cursors for editing
Plug 'mg979/vim-visual-multi', {'branch': 'master'}
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'edkolev/tmuxline.vim'
Plug 'majutsushi/tagbar'
let g:tagbar_ctags_bin = '/usr/local/Cellar/universal-ctags/HEAD-b743975/bin/ctags'
let g:tagbar_ctags_bin = '/usr/local/bin/ctags'
Plug 'itchyny/lightline.vim'
let g:lightline = {
@ -42,6 +42,13 @@ let g:sneak#label = 1
Plug 'machakann/vim-highlightedyank'
let g:highlightedyank_highlight_duration = 100
" Easy commenting for Vim
Plug 'preservim/nerdcommenter'
" Command line fuzzy finder / also provides :Maps
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" NERD Tree - tree explorer
" https://github.com/scrooloose/nerdtree
" http://usevim.com/2012/07/18/nerdtree/
@ -49,14 +56,25 @@ let g:highlightedyank_highlight_duration = 100
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" nerdtree-git-plugin - show git status in NERD Tree
" https://github.com/Xuyuanp/nerdtree-git-plugin
" https://github.com/Xuyuanp/nerdtree-git-plugi
Plug 'Xuyuanp/nerdtree-git-plugin'
" Enforce editor settings
" https://github.com/editorconfig/editorconfig-vim
Plug 'editorconfig/editorconfig-vim'
" languages
" Terminal in floating window
Plug 'voldikss/vim-floaterm'
" Telescope fuzzy find files/grep
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-project.nvim'
"""""""""""""""""""""""""
" => Language Support
"""""""""""""""""""""""""
Plug 'neoclide/jsonc.vim'
Plug 'vim-python/python-syntax'
@ -65,6 +83,9 @@ let g:python_highlight_all = 1
Plug 'JuliaEditorSupport/julia-vim'
let g:latex_to_unicode_auto = 1
" Formatting Julia Files
Plug 'kdheepak/JuliaFormatter.vim'
" themes & colorschemes
Plug 'challenger-deep-theme/vim', { 'as': 'challenger-deep' }
Plug 'dracula/vim', { 'as': 'dracula' }
@ -77,3 +98,26 @@ let g:nord_italic_comments = 1
call plug#end()
""""""""""""""""""""""""""""""
" PLUGIN SETTINGS
""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""
" VIM-FLOATERM
""""""""""""""""""""""""""""""
let g:floaterm_open_command = 'vsplit'
"""""""""""""""""""""
"JULIA FORMATTER
"""""""""""""""""""""
let g:JuliaFormatter_options = {
\ 'indent' : 4,
\ 'margin' : 92,
\ 'always_for_in' : v:false,
\ 'whitespace_typedefs' : v:false,
\ 'whitespace_ops_in_indices' : v:true,
\ }