Compare commits
No commits in common. "942dff9d8c0b76fcbe18f4be45300306b01b1f50" and "b42cc85decd6455111e9b41e29d5235e6d6bd6f0" have entirely different histories.
942dff9d8c
...
b42cc85dec
|
@ -9,6 +9,8 @@
|
||||||
when: root_access
|
when: root_access
|
||||||
- role: dotfiles
|
- role: dotfiles
|
||||||
tags: dotfiles
|
tags: dotfiles
|
||||||
|
- role: vim
|
||||||
|
tags: vim
|
||||||
- role: mnussbaum.base16-builder-ansible # Required for desktop_environment
|
- role: mnussbaum.base16-builder-ansible # Required for desktop_environment
|
||||||
tags:
|
tags:
|
||||||
- color
|
- color
|
||||||
|
|
11
config/automatrop/roles/vim/handlers/main.yml
Normal file
11
config/automatrop/roles/vim/handlers/main.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
- name: Upgrade Neovim plugins
|
||||||
|
command: "nvim +PlugUpgrade +PlugUpdate +PlugInstall +qall!"
|
||||||
|
listen: nvim plugins changed
|
||||||
|
environment:
|
||||||
|
VIMINIT: "source {{ ansible_user_dir }}/.config/nvim/plugininstall.vim"
|
||||||
|
|
||||||
|
- name: Upgrade Vim plugins
|
||||||
|
command: "vim +PlugUpgrade +PlugUpdate +PlugInstall +qall!"
|
||||||
|
listen: vim plugins changed
|
||||||
|
environment:
|
||||||
|
VIMINIT: "source {{ ansible_user_dir }}/.config/vim/plugininstall.vim"
|
20
config/automatrop/roles/vim/tasks/main.yml
Normal file
20
config/automatrop/roles/vim/tasks/main.yml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
- name: Configure vim plugin list
|
||||||
|
template:
|
||||||
|
src: plugininstall.j2
|
||||||
|
dest: "{{ ansible_user_dir }}/.config/{{ variant }}/plugininstall.vim"
|
||||||
|
mode: "u=rw,g=r,o=r"
|
||||||
|
notify:
|
||||||
|
- "{{ variant }} plugins changed"
|
||||||
|
loop: "{{ vim_variants }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: variant
|
||||||
|
|
||||||
|
- name: Configure vim
|
||||||
|
template:
|
||||||
|
src: init.vim.j2
|
||||||
|
dest: "{{ ansible_user_dir }}/.config/{{ variant }}/init.vim"
|
||||||
|
mode: "u=rw,g=r,o=r"
|
||||||
|
loop: "{{ vim_variants }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: variant
|
101
config/automatrop/roles/vim/templates/editor.j2
Normal file
101
config/automatrop/roles/vim/templates/editor.j2
Normal file
|
@ -0,0 +1,101 @@
|
||||||
|
" From https://www.hillelwayne.com/post/intermediate-vim/
|
||||||
|
|
||||||
|
set encoding=utf-8
|
||||||
|
set title
|
||||||
|
|
||||||
|
set number
|
||||||
|
set ruler
|
||||||
|
set wrap
|
||||||
|
|
||||||
|
set scrolloff=10
|
||||||
|
|
||||||
|
set ignorecase
|
||||||
|
set smartcase
|
||||||
|
set gdefault
|
||||||
|
if has('nvim')
|
||||||
|
set inccommand=nosplit " Shows you in realtime what changes your ex command should make.
|
||||||
|
endif
|
||||||
|
|
||||||
|
set incsearch
|
||||||
|
|
||||||
|
set hlsearch
|
||||||
|
|
||||||
|
set tabstop=4
|
||||||
|
set shiftwidth=4
|
||||||
|
set expandtab
|
||||||
|
|
||||||
|
set visualbell
|
||||||
|
set noerrorbells
|
||||||
|
|
||||||
|
set backspace=indent,eol,start
|
||||||
|
|
||||||
|
set hidden
|
||||||
|
set updatetime=250
|
||||||
|
set lazyredraw " Do not redraw screen in the middle of a macro. Makes them complete faster.
|
||||||
|
|
||||||
|
set cursorcolumn
|
||||||
|
|
||||||
|
set splitbelow
|
||||||
|
|
||||||
|
" Turn off relativenumber only for insert mode.
|
||||||
|
if has('nvim')
|
||||||
|
set relativenumber
|
||||||
|
augroup every
|
||||||
|
autocmd!
|
||||||
|
au InsertEnter * set norelativenumber
|
||||||
|
au InsertLeave * set relativenumber
|
||||||
|
augroup END
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Keep undo history across sessions by storing it in a file
|
||||||
|
if has('persistent_undo')
|
||||||
|
let myUndoDir = expand(vimDir . '/undodir')
|
||||||
|
" Create dirs
|
||||||
|
call system('mkdir ' . myUndoDir)
|
||||||
|
let &undodir = myUndoDir
|
||||||
|
set undofile
|
||||||
|
endif
|
||||||
|
|
||||||
|
syntax enable
|
||||||
|
|
||||||
|
" From http://stackoverflow.com/a/5004785/2766106
|
||||||
|
set list
|
||||||
|
set listchars=tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_
|
||||||
|
set showbreak=↪
|
||||||
|
|
||||||
|
filetype on
|
||||||
|
filetype plugin on
|
||||||
|
filetype indent on
|
||||||
|
|
||||||
|
set wildmode=longest:full,full
|
||||||
|
set wildmenu
|
||||||
|
set showcmd
|
||||||
|
|
||||||
|
" Completion
|
||||||
|
|
||||||
|
" Avoid showing message extra message when using completion
|
||||||
|
set shortmess+=c
|
||||||
|
|
||||||
|
" Close the file explorer once you select a file
|
||||||
|
let g:netrw_fastbrowse = 0
|
||||||
|
|
||||||
|
" Allow saving of files as sudo when I forgot to start vim using sudo.
|
||||||
|
" From https://stackoverflow.com/a/7078429
|
||||||
|
cmap w!! w !sudo tee > /dev/null %
|
||||||
|
|
||||||
|
imap jk <Esc>
|
||||||
|
vmap <Enter> <Esc>
|
||||||
|
|
||||||
|
nmap <Enter> o<Esc>
|
||||||
|
nmap <C-H> :bp<CR>
|
||||||
|
nmap <C-L> :bn<CR>
|
||||||
|
nmap <C-K> kkkkkkkkkkkkkkkkkkkkk
|
||||||
|
nmap <C-J> jjjjjjjjjjjjjjjjjjjjj
|
||||||
|
|
||||||
|
" \s to replace globally the word under the cursor
|
||||||
|
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
|
||||||
|
|
||||||
|
" add extensions to syntax
|
||||||
|
au BufNewFile,BufRead *.jinja set filetype=jinja2
|
||||||
|
|
||||||
|
command Reload source $MYVIMRC
|
23
config/automatrop/roles/vim/templates/init.vim.j2
Normal file
23
config/automatrop/roles/vim/templates/init.vim.j2
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
set nocompatible
|
||||||
|
filetype on
|
||||||
|
|
||||||
|
" SET PATHS
|
||||||
|
|
||||||
|
set runtimepath+=~/.config/{{ variant }}
|
||||||
|
let vimDir = '$HOME/.cache/{{ variant }}'
|
||||||
|
call system('mkdir ' . vimDir)
|
||||||
|
let &runtimepath.=','.vimDir
|
||||||
|
set viminfo+=n~/.cache/{{ variant }}/viminfo
|
||||||
|
|
||||||
|
" PLUGIN INSTALLATION
|
||||||
|
|
||||||
|
source ~/.config/{{ variant }}/plugininstall.vim
|
||||||
|
|
||||||
|
" EDITOR CONFIGURATION
|
||||||
|
|
||||||
|
{% include 'editor.j2' %}
|
||||||
|
|
||||||
|
" PLUGINS CONFIGURATION
|
||||||
|
|
||||||
|
{% include 'pluginconfig.j2' %}
|
||||||
|
|
2
config/automatrop/roles/vim/templates/pluginconfig.j2
Normal file
2
config/automatrop/roles/vim/templates/pluginconfig.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{% set plugins = namespace(sources=[]) %}
|
||||||
|
{% include 'pluginlist.j2' %}
|
13
config/automatrop/roles/vim/templates/plugininstall.j2
Normal file
13
config/automatrop/roles/vim/templates/plugininstall.j2
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
source ~/.config/vim/plug.vim
|
||||||
|
{% set plugins = namespace(sources=[]) %}
|
||||||
|
{% import 'pluginlist.j2' as pluginlist with context %}
|
||||||
|
|
||||||
|
call plug#begin('~/.cache/{{ variant }}/plugged')
|
||||||
|
{% for link, extra in plugins.sources %}
|
||||||
|
{% if extra %}
|
||||||
|
Plug '{{ link }}', { {% for k, v in extra.items() %}'{{ k }}': '{{ v }}', {% endfor %} }
|
||||||
|
{% else %}
|
||||||
|
Plug '{{ link }}'
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
call plug#end()
|
55
config/automatrop/roles/vim/templates/pluginlist.j2
Normal file
55
config/automatrop/roles/vim/templates/pluginlist.j2
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
{% macro add_source(link, extra={}) -%}
|
||||||
|
{% set plugins.sources = plugins.sources + [(link, extra)] %}
|
||||||
|
{%- endmacro -%}
|
||||||
|
{% macro use_plugin(name) -%}
|
||||||
|
" START PLUGIN CONFIG {{ name }}
|
||||||
|
{% include 'plugins/' + name + '.j2' +%}
|
||||||
|
" END PLUGIN CONFIG {{ name }}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
" Visuals
|
||||||
|
{{ use_plugin('devicons') }}
|
||||||
|
{% if variant == 'nvim' %}
|
||||||
|
{{ use_plugin('specs') }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
" Theme
|
||||||
|
source ~/.config/vim/theme.vim
|
||||||
|
|
||||||
|
" Snippets
|
||||||
|
{{ use_plugin('vsnip') }}
|
||||||
|
|
||||||
|
" Auto-completion
|
||||||
|
{% if variant == 'nvim' %}
|
||||||
|
{{ use_plugin('nvim_compe') }}
|
||||||
|
{% else %}
|
||||||
|
{{ use_plugin('deoplete') }}
|
||||||
|
{{ use_plugin('supertab') }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
" Undo management
|
||||||
|
{{ use_plugin('undotree') }}
|
||||||
|
|
||||||
|
" Git helpers
|
||||||
|
{{ use_plugin('fugitive') }}
|
||||||
|
{% if variant == 'nvim' %}
|
||||||
|
{{ use_plugin('gitsigns') }}
|
||||||
|
{% else %}
|
||||||
|
{{ use_plugin('gitgutter') }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
" Language-specific stuff
|
||||||
|
{{ use_plugin('tcomment') }}
|
||||||
|
{{ use_plugin('languagetool') }}
|
||||||
|
{{ use_plugin('pandoc') }}
|
||||||
|
{% if variant == 'nvim' %}
|
||||||
|
{{ use_plugin('dap') }}
|
||||||
|
{{ use_plugin('colorizer') }}
|
||||||
|
{% else %}
|
||||||
|
{% if 'c' in dev_stuffs or 'c++' in dev_stuffs %}
|
||||||
|
{{ use_plugin('vebugger') }}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if 'ansible' in dev_stuffs %}
|
||||||
|
{{ use_plugin('ansible') }}
|
||||||
|
{% endif %}
|
10
config/automatrop/roles/vim/templates/plugins/ale.j2
Normal file
10
config/automatrop/roles/vim/templates/plugins/ale.j2
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
" Asynchronous Lint Engine
|
||||||
|
" LSP client for vim and nvim
|
||||||
|
{{ add_source('dense-analysis/ale') }}
|
||||||
|
|
||||||
|
nmap <F3> :ALEFix<CR>
|
||||||
|
|
||||||
|
let g:ale_sign_error = '×'
|
||||||
|
let g:ale_sign_warning = '!'
|
||||||
|
let g:ale_completion_enabled = 1
|
||||||
|
let g:ale_fixers = ['autopep8', 'shfmt', 'uncrustify', 'remove_trailing_lines', 'trim_whitespace', 'phpcbf']
|
2
config/automatrop/roles/vim/templates/plugins/ansible.j2
Normal file
2
config/automatrop/roles/vim/templates/plugins/ansible.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{# Various for Ansible #}
|
||||||
|
{{ add_source('pearofducks/ansible-vim', { 'do': './UltiSnips/generate.sh'}) -}}
|
|
@ -0,0 +1,14 @@
|
||||||
|
{{ add_source('prabirshrestha/asyncomplete.vim') -}}
|
||||||
|
let g:asyncomplete_auto_popup = 1
|
||||||
|
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||||
|
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||||
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
|
||||||
|
imap <c-space> <Plug>(asyncomplete_force_refresh)
|
||||||
|
|
||||||
|
{{ add_source('prabirshrestha/asyncomplete-file.vim') -}}
|
||||||
|
au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({
|
||||||
|
\ 'name': 'file',
|
||||||
|
\ 'whitelist': ['*'],
|
||||||
|
\ 'priority': 10,
|
||||||
|
\ 'completor': function('asyncomplete#sources#file#completor')
|
||||||
|
\ }))
|
|
@ -0,0 +1,7 @@
|
||||||
|
{# Display the actual color for color codes " #}
|
||||||
|
{{ add_source('norcalli/nvim-colorizer.lua') -}}
|
||||||
|
set termguicolors
|
||||||
|
lua << EOF
|
||||||
|
require'colorizer'.setup()
|
||||||
|
EOF
|
||||||
|
{# TODO Enable for css functions too #}
|
2
config/automatrop/roles/vim/templates/plugins/dap.j2
Normal file
2
config/automatrop/roles/vim/templates/plugins/dap.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{# Debug Adapter Protocol client #}
|
||||||
|
{{ add_source('mfussenegger/nvim-dap') -}}
|
26
config/automatrop/roles/vim/templates/plugins/deoplete.j2
Normal file
26
config/automatrop/roles/vim/templates/plugins/deoplete.j2
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{# Auto-completion for vim and nvim #}
|
||||||
|
{% if variant == 'nvim' -%}
|
||||||
|
{{ add_source('Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}) -}}
|
||||||
|
{% else -%}
|
||||||
|
{{ add_source('Shougo/deoplete.nvim') -}}
|
||||||
|
{{ add_source('roxma/nvim-yarp') -}}
|
||||||
|
{{ add_source('roxma/vim-hug-neovim-rpc') -}}
|
||||||
|
{% endif -%}
|
||||||
|
{% raw %}
|
||||||
|
let g:deoplete#enable_at_startup = 1
|
||||||
|
inoremap <silent><expr> <TAB>
|
||||||
|
\ pumvisible() ? "\<C-n>" :
|
||||||
|
\ <SID>check_back_space() ? "\<TAB>" :
|
||||||
|
\ deoplete#manual_complete()
|
||||||
|
function! s:check_back_space() abort "{{{
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~ '\s'
|
||||||
|
endfunction"}}}
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
" suggested by ssemshi to make it not too slow
|
||||||
|
" let g:deoplete#auto_complete_delay = 100
|
||||||
|
call deoplete#custom#option({
|
||||||
|
\ 'auto_complete_delay': 100,
|
||||||
|
\ 'smart_case': v:true,
|
||||||
|
\ })
|
|
@ -0,0 +1,5 @@
|
||||||
|
{% if variant == 'nvim' %}
|
||||||
|
{{ add_source('kyazdani42/nvim-web-devicons') -}}
|
||||||
|
{% else %}
|
||||||
|
{{ add_source('ryanoasis/vim-devicons') -}}
|
||||||
|
{% endif %}
|
|
@ -0,0 +1,4 @@
|
||||||
|
{# Git basics #}
|
||||||
|
{{ add_source('tpope/vim-fugitive') -}}
|
||||||
|
{# Open files in GitLab #}
|
||||||
|
{{ add_source('shumphrey/fugitive-gitlab.vim') -}}
|
|
@ -0,0 +1,2 @@
|
||||||
|
{# Show changed git lines in the gutter #}
|
||||||
|
{{ add_source('airblade/vim-gitgutter') -}}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{# Show changed git lines in the gutter #}
|
||||||
|
{{ add_source('lewis6991/gitsigns.nvim') -}}
|
||||||
|
{# Dependency #}
|
||||||
|
{{ add_source('nvim-lua/plenary.nvim') -}}
|
||||||
|
lua << EOF
|
||||||
|
require('gitsigns').setup()
|
||||||
|
EOF
|
|
@ -0,0 +1,20 @@
|
||||||
|
{{ add_source('autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh'}) -}}
|
||||||
|
|
||||||
|
let g:LanguageClient_serverCommands = {
|
||||||
|
\ 'python': ['pyls'],
|
||||||
|
\ 'sh': ['bash-language-server', 'start'],
|
||||||
|
\ }
|
||||||
|
let g:LanguageClient_loggingFile = expand('~/.cache/{{ variant }}/LanguageClient.log')
|
||||||
|
|
||||||
|
function LC_maps()
|
||||||
|
if has_key(g:LanguageClient_serverCommands, &filetype)
|
||||||
|
nnoremap <buffer> <silent> K :call LanguageClient#textDocument_hover()<cr>
|
||||||
|
nnoremap <buffer> <silent> gd :call LanguageClient#textDocument_definition()<CR>
|
||||||
|
nnoremap <buffer> <silent> gD :call LanguageClient#textDocument_references()<CR>
|
||||||
|
nnoremap <buffer> <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
|
||||||
|
nnoremap <buffer> <silent> <F3> :call LanguageClient#textDocument_formatting()<CR>
|
||||||
|
set completefunc=LanguageClient#complete
|
||||||
|
set omnifunc=LanguageClient#complete
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
autocmd FileType * call LC_maps()
|
|
@ -0,0 +1,3 @@
|
||||||
|
{# Check grammar for human languages #}
|
||||||
|
{{ add_source('dpelle/vim-LanguageTool') -}}
|
||||||
|
let g:languagetool_jar = "/usr/share/java/languagetool/languagetool-commandline.jar"
|
|
@ -1,4 +1,7 @@
|
||||||
-- Default recommended config
|
{{ add_source('hrsh7th/nvim-compe') -}}
|
||||||
|
{# I'm a bit lost with all this, so this is the default recommended config,
|
||||||
|
using vim-vsnip because the proposed configuration for tab-completion uses it, so… #}
|
||||||
|
lua << EOF
|
||||||
require'compe'.setup {
|
require'compe'.setup {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
autocomplete = true;
|
autocomplete = true;
|
||||||
|
@ -29,9 +32,17 @@ require'compe'.setup {
|
||||||
vsnip = true;
|
vsnip = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
EOF
|
||||||
|
set completeopt=menuone,noselect
|
||||||
|
|
||||||
-- Vim instructions were here
|
|
||||||
|
|
||||||
|
inoremap <silent><expr> <C-Space> compe#complete()
|
||||||
|
inoremap <silent><expr> <CR> compe#confirm('<CR>')
|
||||||
|
inoremap <silent><expr> <C-e> compe#close('<C-e>')
|
||||||
|
inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })
|
||||||
|
inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })
|
||||||
|
|
||||||
|
lua << EOF
|
||||||
local t = function(str)
|
local t = function(str)
|
||||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
end
|
end
|
||||||
|
@ -70,3 +81,4 @@ vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||||
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||||
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||||
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||||
|
EOF
|
6
config/automatrop/roles/vim/templates/plugins/pandoc.j2
Normal file
6
config/automatrop/roles/vim/templates/plugins/pandoc.j2
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{# Pandoc specific stuff because there's no LSP for it #}
|
||||||
|
{{ add_source('vim-pandoc/vim-pandoc') -}}
|
||||||
|
{{ add_source('vim-pandoc/vim-pandoc-syntax') -}}
|
||||||
|
let g:pandoc#modules#disabled = ["folding"]
|
||||||
|
let g:pandoc#spell#enabled = 0
|
||||||
|
let g:pandoc#syntax#conceal#use = 0
|
4
config/automatrop/roles/vim/templates/plugins/reload.j2
Normal file
4
config/automatrop/roles/vim/templates/plugins/reload.j2
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{# Live reload #}
|
||||||
|
{{ add_source('famiu/nvim-reload') -}}
|
||||||
|
{{ add_source('nvim-lua/plenary.nvim') -}}
|
||||||
|
{# Not used, this breaks color, and source $MYVIMRC is all that we need to reload colorscheme #}
|
2
config/automatrop/roles/vim/templates/plugins/semshi.j2
Normal file
2
config/automatrop/roles/vim/templates/plugins/semshi.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{# Semantic highlighting for Python for neovim #}
|
||||||
|
{{ add_source('numirias/semshi', {'do': ':UpdateRemotePlugins'}) -}}
|
6
config/automatrop/roles/vim/templates/plugins/shade.j2
Normal file
6
config/automatrop/roles/vim/templates/plugins/shade.j2
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{# Dim inactive windows #}
|
||||||
|
{# Not working very well, at least with undotree #}
|
||||||
|
{{add_source('sunjon/shade.nvim')-}}
|
||||||
|
lua << EOF
|
||||||
|
require'shade'.setup()
|
||||||
|
EOF
|
|
@ -0,0 +1,2 @@
|
||||||
|
{# Smoooooth scrolling #}
|
||||||
|
{{ add_source('terryma/vim-smooth-scroll') -}}
|
15
config/automatrop/roles/vim/templates/plugins/specs.j2
Normal file
15
config/automatrop/roles/vim/templates/plugins/specs.j2
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{# Flashes under the cursor when moving far #}
|
||||||
|
{{ add_source('edluffy/specs.nvim') -}}
|
||||||
|
lua << EOF
|
||||||
|
require('specs').setup{
|
||||||
|
popup = {
|
||||||
|
delay_ms = 0, -- delay before popup displays
|
||||||
|
inc_ms = 10, -- time increments used for fade/resize effects
|
||||||
|
blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend
|
||||||
|
width = 10,
|
||||||
|
winhl = "PMenu",
|
||||||
|
fader = require('specs').pulse_fader,
|
||||||
|
resizer = require('specs').shrink_resizer
|
||||||
|
},
|
||||||
|
}
|
||||||
|
EOF
|
|
@ -0,0 +1,7 @@
|
||||||
|
{# Use TAB for autocompletion #}
|
||||||
|
{{ add_source('ervandew/supertab') -}}
|
||||||
|
let g:SuperTabLongestEnhanced = 1
|
||||||
|
let g:SuperTabLongestHighlight = 1
|
||||||
|
{# TODO longest doesn't work, even when longest is set in completeopt #}
|
||||||
|
let g:SuperTabDefaultCompletionType = "<c-n>" " Go down when completing
|
||||||
|
let g:SuperTabContextDefaultCompletionType = "<c-n>"
|
|
@ -0,0 +1,2 @@
|
||||||
|
{# Language-aware (un)commenting #}
|
||||||
|
{{ add_source('tomtom/tcomment_vim') -}}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{# Navigate undo #}
|
||||||
|
{{ add_source('mbbill/undotree') -}}
|
||||||
|
nmap <space>u :UndotreeToggle<CR>
|
|
@ -0,0 +1,2 @@
|
||||||
|
{# Debug from the editor #}
|
||||||
|
{{ add_source('idanarye/vim-vebugger') -}}
|
12
config/automatrop/roles/vim/templates/plugins/vista.j2
Normal file
12
config/automatrop/roles/vim/templates/plugins/vista.j2
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{# Tag bar #}
|
||||||
|
{{ add_source('liuchengxu/vista.vim') -}}
|
||||||
|
nmap <space>s :Vista!!<CR>
|
||||||
|
let g:vista_icon_indent = ["▸ ", ""]
|
||||||
|
|
||||||
|
let g:vista#renderer#enable_icon = 1
|
||||||
|
|
||||||
|
" The default icons can't be suitable for all the filetypes, you can extend it as you wish.
|
||||||
|
let g:vista#renderer#icons = {
|
||||||
|
\ "function": "f",
|
||||||
|
\ "variable": "x",
|
||||||
|
\ }
|
4
config/automatrop/roles/vim/templates/plugins/vsnip.j2
Normal file
4
config/automatrop/roles/vim/templates/plugins/vsnip.j2
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{{ add_source('hrsh7th/vim-vsnip') -}}
|
||||||
|
{{ add_source('hrsh7th/vim-vsnip-integ') -}}
|
||||||
|
{{ add_source('rafamadriz/friendly-snippets') -}}
|
||||||
|
{# TODO Ansible snippets? #}
|
|
@ -21,7 +21,7 @@
|
||||||
# FIXME Still want this despite using nixvim
|
# FIXME Still want this despite using nixvim
|
||||||
gpg = {
|
gpg = {
|
||||||
enable = true;
|
enable = true;
|
||||||
homedir = "${config.xdg.stateHome}/gnupg";
|
homedir = "${config.xdg.dataHome}/gnupg";
|
||||||
settings = {
|
settings = {
|
||||||
# Remove fluff
|
# Remove fluff
|
||||||
no-greeting = true;
|
no-greeting = true;
|
||||||
|
|
|
@ -34,40 +34,6 @@ in
|
||||||
|
|
||||||
programs.nixvim = {
|
programs.nixvim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
options = {
|
|
||||||
# From https://www.hillelwayne.com/post/intermediate-vim/
|
|
||||||
title = true;
|
|
||||||
number = true;
|
|
||||||
relativenumber = true;
|
|
||||||
scrolloff = 10;
|
|
||||||
lazyredraw = true; # Do not redraw screen in the middle of a macro. Makes them complete faster.
|
|
||||||
cursorcolumn = true;
|
|
||||||
|
|
||||||
ignorecase = true;
|
|
||||||
smartcase = true;
|
|
||||||
gdefault = true;
|
|
||||||
|
|
||||||
tabstop = 4;
|
|
||||||
shiftwidth = 4;
|
|
||||||
expandtab = true;
|
|
||||||
|
|
||||||
splitbelow = true;
|
|
||||||
visualbell = true;
|
|
||||||
|
|
||||||
updatetime = 250;
|
|
||||||
undofile = true;
|
|
||||||
|
|
||||||
# From http://stackoverflow.com/a/5004785/2766106
|
|
||||||
list = true;
|
|
||||||
listchars = "tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_";
|
|
||||||
showbreak = "↪";
|
|
||||||
|
|
||||||
wildmode = "longest:full,full";
|
|
||||||
wildmenu = true;
|
|
||||||
};
|
|
||||||
globals = {
|
|
||||||
netrw_fastbrowse = 0; # Close the file explorer once you select a file
|
|
||||||
};
|
|
||||||
colorschemes.base16 = {
|
colorschemes.base16 = {
|
||||||
# FIXME Dynamic... or use stylix
|
# FIXME Dynamic... or use stylix
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -80,8 +46,6 @@ in
|
||||||
specs = {
|
specs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
min_jump = 5;
|
min_jump = 5;
|
||||||
fader = { builtin = "pulse_fader"; };
|
|
||||||
resizer = { builtin = "shrink_resizer"; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Tabline
|
# Tabline
|
||||||
|
@ -211,16 +175,6 @@ in
|
||||||
};
|
};
|
||||||
# TODO Investigate https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
# TODO Investigate https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||||
indent-blankline.enable = true; # 23.11 integrate with rainbow-delimiters and use more of the options
|
indent-blankline.enable = true; # 23.11 integrate with rainbow-delimiters and use more of the options
|
||||||
|
|
||||||
undotree.enable = true; # Navigate edition history
|
|
||||||
|
|
||||||
# Git
|
|
||||||
fugitive.enable = true; # Git basics
|
|
||||||
gitsigns.enable = true; # Show changed lines in the gutter
|
|
||||||
|
|
||||||
# Language-specific
|
|
||||||
# dap.enable = true; # Debug Adapter Protocol client # 23.11
|
|
||||||
nvim-colorizer.enable = true; # Display colors of color-codes
|
|
||||||
};
|
};
|
||||||
extraPlugins = with pkgs.vimPlugins; [
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
nvim-scrollview # Scroll bar
|
nvim-scrollview # Scroll bar
|
||||||
|
@ -256,27 +210,6 @@ in
|
||||||
# Treesitter
|
# Treesitter
|
||||||
nvim-ts-rainbow # Randomly color parenthesis pairs
|
nvim-ts-rainbow # Randomly color parenthesis pairs
|
||||||
# 23.11: Replace with plugins.rainbow-delimiters
|
# 23.11: Replace with plugins.rainbow-delimiters
|
||||||
|
|
||||||
# Snippets
|
|
||||||
vim-vsnip
|
|
||||||
vim-vsnip-integ
|
|
||||||
friendly-snippets
|
|
||||||
|
|
||||||
# Auto-completion
|
|
||||||
nvim-compe
|
|
||||||
# TODO Archived. Maybe use nvim-cmp and plugins instead?
|
|
||||||
|
|
||||||
# Git
|
|
||||||
fugitive-gitlab-vim # Open files in GitLab
|
|
||||||
# TODO Connect it!
|
|
||||||
|
|
||||||
# Language-specific
|
|
||||||
tcomment_vim # Language-aware (un)commenting
|
|
||||||
vim-LanguageTool # Check grammar for human languages
|
|
||||||
vim-pandoc # Pandoc-specific stuff because there's no LSP for it
|
|
||||||
vim-pandoc-syntax
|
|
||||||
nvim-dap # Debug Adapter Protocol client
|
|
||||||
ansible-vim # FIXME See if it doesn't require to do ./UltiSnips/generate.sh
|
|
||||||
];
|
];
|
||||||
extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [
|
extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [
|
||||||
./vim/feline.lua
|
./vim/feline.lua
|
||||||
|
@ -285,77 +218,16 @@ in
|
||||||
./vim/nvim-ts-rainbow.lua
|
./vim/nvim-ts-rainbow.lua
|
||||||
];
|
];
|
||||||
extraConfigVim = ''
|
extraConfigVim = ''
|
||||||
" GENERAL
|
|
||||||
|
|
||||||
" Avoid showing message extra message when using completion
|
|
||||||
set shortmess+=c
|
|
||||||
|
|
||||||
command Reload source $MYVIMRC
|
|
||||||
|
|
||||||
" PLUGINS
|
|
||||||
|
|
||||||
" vim-gutentags
|
" vim-gutentags
|
||||||
let g:gutentags_cache_dir = expand('~/.cache/nvim/tags')
|
let g:gutentags_cache_dir = expand('~/.cache/nvim/tags')
|
||||||
|
|
||||||
" nvim-compe
|
|
||||||
" Copy-pasted because I couldn't be bothered
|
|
||||||
set completeopt=menuone,noselect
|
|
||||||
|
|
||||||
inoremap <silent><expr> <C-Space> compe#complete()
|
|
||||||
inoremap <silent><expr> <CR> compe#confirm('<CR>')
|
|
||||||
inoremap <silent><expr> <C-e> compe#close('<C-e>')
|
|
||||||
inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })
|
|
||||||
inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })
|
|
||||||
|
|
||||||
" languagetool
|
|
||||||
let g:languagetool_cmd = "${pkgs.languagetool}/bin/languagetool-commandline"
|
|
||||||
" TODO Doesn't work
|
|
||||||
|
|
||||||
" vim-pandox
|
|
||||||
let g:pandoc#modules#disabled = ["folding"]
|
|
||||||
let g:pandoc#spell#enabled = 0
|
|
||||||
let g:pandoc#syntax#conceal#use = 0
|
|
||||||
|
|
||||||
'';
|
'';
|
||||||
autoCmd = [
|
autoCmd = [
|
||||||
# Turn off relativenumber only for insert mode
|
|
||||||
{ event = "InsertEnter *"; command = "set norelativenumber"; }
|
|
||||||
{ event = "InsertLeave *"; command = "set relativenumber"; }
|
|
||||||
|
|
||||||
# Additional extensions
|
|
||||||
{ event = "BufNewFile,BufRead"; pattern = "*.jinja"; command = "set filetype=jinja2"; } # TODO Probably GH-specific?
|
|
||||||
|
|
||||||
# vim-easy-align: Align Markdown tables
|
# vim-easy-align: Align Markdown tables
|
||||||
{ event = "FileType markdown"; command = "vmap <Bar> :EasyAlign*<Bar><Enter>"; }
|
{ event = "FileType markdown"; command = "vmap <Bar> :EasyAlign*<Bar><Enter>"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
userCommands = {
|
|
||||||
# Reload = { command = "source $MYVIRMC"; };
|
|
||||||
# TODO Is not working, options is set to nil even though it shouldn't
|
|
||||||
};
|
|
||||||
|
|
||||||
# 23.11: Use keymaps, seems better
|
# 23.11: Use keymaps, seems better
|
||||||
maps = {
|
maps = {
|
||||||
# GENERAL
|
|
||||||
|
|
||||||
# Allow saving of files as sudo when I forgot to start vim using sudo.
|
|
||||||
# From https://stackoverflow.com/a/7078429
|
|
||||||
command."w!!" = { action = "w !sudo tee > /dev/null %"; };
|
|
||||||
|
|
||||||
insert."jk" = { action = "<Esc>"; };
|
|
||||||
visual."<Enter>" = { action = "<Esc>"; };
|
|
||||||
normal."<Enter>" = { action = "o<Esc>"; };
|
|
||||||
|
|
||||||
# normal."<C-H>" = { action = ":bp<CR>"; };
|
|
||||||
# normal."<C-L>" = { action = ":bn<CR>"; };
|
|
||||||
normal."<C-K>" = { action = "kkkkkkkkkkkkkkkkkkkkk"; };
|
|
||||||
normal."<C-J>" = { action = "jjjjjjjjjjjjjjjjjjjjj"; };
|
|
||||||
|
|
||||||
# \s to replace globally the word under the cursor
|
|
||||||
normal."<Leader>s" = { action = ":%s/\\<<C-r><C-w>\\>/"; };
|
|
||||||
|
|
||||||
# PLUGINS
|
|
||||||
|
|
||||||
# barbar
|
# barbar
|
||||||
normal."<C-H>" = { action = "<Cmd>BufferPrevious<CR>"; silent = true; };
|
normal."<C-H>" = { action = "<Cmd>BufferPrevious<CR>"; silent = true; };
|
||||||
normal."<C-L>" = { action = "<Cmd>BufferNext<CR>"; silent = true; };
|
normal."<C-L>" = { action = "<Cmd>BufferNext<CR>"; silent = true; };
|
||||||
|
@ -379,9 +251,6 @@ in
|
||||||
# symbols-outline-nvim
|
# symbols-outline-nvim
|
||||||
normal."<Space>s" = { action = "<Cmd>SymbolsOutline<CR>"; silent = true; };
|
normal."<Space>s" = { action = "<Cmd>SymbolsOutline<CR>"; silent = true; };
|
||||||
|
|
||||||
# undotree
|
|
||||||
normal."<Space>u" = { action = "<Cmd>UndotreeToggle<CR>"; silent = true; };
|
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue