Removed commit history

Signed-off-by: Marko Korhonen <marko.korhonen@reekynet.com>
This commit is contained in:
Marko Korhonen 2019-10-26 20:05:31 +03:00
commit b1335a3628
199 changed files with 36930 additions and 0 deletions

View file

@ -0,0 +1,45 @@
{
"python.jediEnabled": false,
"python.setLinter": "pylint",
"suggest.noselect": false,
"suggest.echodocSupport": true,
"suggest.maxCompleteItemCount": 20,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact"
],
"eslint.filetypes": [
"javascript",
"typescript",
"typescriptreact",
"javascriptreact"
],
"eslint.autoFixOnSave": false,
"prettier.singleQuote": true,
"diagnostic.errorSign": "•",
"diagnostic.warningSign": "•",
"diagnostic.infoSign": "•",
"suggest.snippetIndicator": "~",
"languageserver": {
"bash": {
"command": "bash-language-server",
"args": ["start"],
"filetypes": ["sh"],
"ignoredRootPaths": ["~"]
},
"xml": {
"command": "xml-language-server",
"args": ["start"],
"filetypes": ["xml"],
"ignoredRootPaths": ["~"]
},
"efm": {
"command": "~/.bin/go/bin/efm-langserver",
"args": [],
"filetypes": ["markdown"]
}
}
}

View file

@ -0,0 +1,97 @@
" Auto-install vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
" Set coc extensions
let g:coc_global_extensions = [
\ 'coc-tsserver',
\ 'coc-html',
\ 'coc-tsserver',
\ 'coc-json',
\ 'coc-yaml',
\ 'coc-highlight',
\ 'coc-vimtex',
\ 'coc-prettier',
\ 'coc-python',
\ 'coc-emmet'
\ ]
call plug#begin()
" Make editing passwords safer
Plug 'https://git.zx2c4.com/password-store', { 'rtp': 'contrib/vim/redact_pass.vim' }
" Pandoc live preview
Plug 'ReekyMarko/pandoc-preview.vim'
" Spelling
Plug 'vim-scripts/Vimchant'
" Pandoc plugin
Plug 'vim-pandoc/vim-pandoc'
" Fuzzy finder
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
" This is so I can use vim as a diff pager
Plug 'powerman/vim-plugin-AnsiEsc'
" Airline statusline
Plug 'vim-airline/vim-airline'
" Syntax plugins
Plug 'stephpy/vim-yaml'
Plug 'vim-pandoc/vim-pandoc-syntax'
Plug 'leafgarland/typescript-vim'
Plug 'ianks/vim-tsx'
Plug 'kevinoid/vim-jsonc'
Plug 'MaxMEllon/vim-jsx-pretty'
Plug 'zplugin/zplugin-vim-syntax'
Plug 'aouelete/sway-vim-syntax'
" Read editorconfig settings
Plug 'editorconfig/editorconfig-vim'
" Make directory if it doesn't exist
Plug 'pbrisbin/vim-mkdir'
" Tree explorer
Plug 'scrooloose/nerdtree'
" Moar snippets
Plug 'honza/vim-snippets'
" Filetype icons
Plug 'ryanoasis/vim-devicons'
" A personal wiki for vim
Plug 'vimwiki/vimwiki'
" Surround stuff with brackets and quotes
Plug 'tpope/vim-surround'
" Do stuff as sudo
Plug 'lambdalisue/suda.vim'
" Conguer of Completion
Plug 'neoclide/coc.nvim', {'do': './install.sh nightly'}
" Git wrapper
Plug 'tpope/vim-fugitive'
" Git diff in gutter
Plug 'airblade/vim-gitgutter'
" Gpg support
Plug 'jamessan/vim-gnupg'
" Colorscheme
Plug 'morhetz/gruvbox'
" Latex plugin
Plug 'lervag/vimtex'
call plug#end()

View file

@ -0,0 +1,44 @@
" Set colorscheme
colorscheme gruvbox
" Enable italics
let g:gruvbox_italic = 1
" Disable mode indicator because airline shows it
set noshowmode
" True color support
set termguicolors
" Airline
set laststatus=2
set encoding=utf-8
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_section_warning = ''
let g:airline_section_error = ''
let g:airline_theme='gruvbox'
" Line numbering
set number
set relativenumber
" Always show signcolumn
set signcolumn=yes
" Autoindent and syntax highlight
set autoindent
set smartindent
syntax on
filetype on
filetype plugin indent on
set tabstop=4
set shiftwidth=4
" Make gutter and cursorline bg transparent
highlight CursorLineNr guibg=transparent
highlight SignColumn guibg=transparent
highlight GitGutterAdd guibg=transparent guifg=#b8bb26
highlight GitGutterChange guibg=transparent guifg=#8ec07c
highlight GitGutterDelete guibg=transparent guifg=#fb4934
highlight GitGutterChangeDelete guibg=transparent guifg=#8ec07c

View file

@ -0,0 +1,37 @@
" Toggle nerdtree
map <silent> <C-t> :NERDTreeToggle<CR>
" Markdown preview
nmap <C-s> <Plug>MarkdownPreview
nmap <M-s> <Plug>MarkdownPreviewStop
nmap <C-p> <Plug>MarkdownPreviewToggle
" FZF
nmap <C-f> :Files<CR>
nmap <C-g> :Rg<CR>
" Ripgrep command customization
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --hidden --line-number --no-heading --color=always --smart-case '.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
set splitbelow
set splitright
" Move between buffers
nnoremap <C-N> :bn<CR>
nnoremap <C-B> :bp<CR>
" Move between splits
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Enable mouse
set mouse=a
" Preview with pandoc
nnoremap <leader>v :PandocPreview<cr>

View file

@ -0,0 +1,129 @@
" Enable symbol highlight
autocmd CursorHold * silent call CocActionAsync('highlight')
" If hidden is not set, TextEdit might fail.
set hidden
" Some servers have issues with backup files, see #649
set nobackup
set nowritebackup
" Better display for messages
set cmdheight=2
" Smaller updatetime for CursorHold & CursorHoldI
set updatetime=300
" Don't give |ins-completion-menu| messages.
set shortmess+=c
" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
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 <cr> to confirm snippet
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() :
\"\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Use `[c` and `]c` to navigate diagnostics
nmap <silent> [c <Plug>(coc-diagnostic-prev)
nmap <silent> ]c <Plug>(coc-diagnostic-next)
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
" Highlight symbol under cursor on CursorHold
autocmd CursorHold * silent call CocActionAsync('highlight')
" Remap for rename current word
nmap <leader>rn <Plug>(coc-rename)
" Remap for format selected region
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap for do codeAction of current line
nmap <leader>ac <Plug>(coc-codeaction)
" Fix autofix problem of current line
nmap <leader>qf <Plug>(coc-fix-current)
" Use `:Format` to format current buffer
command! -nargs=0 Format :call CocAction('format')
" Use `:Fold` to fold current buffer
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add diagnostic info for https://github.com/itchyny/lightline.vim
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'cocstatus', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'cocstatus': 'coc#status'
\ },
\ }
" Using CocList
" Show all diagnostics
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions
nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
" Show commands
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document
nnoremap <silent> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent> <space>j :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list
nnoremap <silent> <space>p :<C-u>CocListResume<CR>

View file

@ -0,0 +1,9 @@
" LaTex settings
let g:vimtex_view_method='zathura'
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_MultipleCompileFormats='pdf, aux'
let g:vimtex_compiler_progname='nvr'
" YAML settings
au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab

View file

@ -0,0 +1,34 @@
" Enable python support
let g:python3_host_prog='/usr/bin/python3'
let pyxversion=3
" Use suda by default
let g:suda_smart_edit = 1
" Remap exit terminal mode to esc
tnoremap <Esc> <C-\><C-n>
" Use system clipboard
set clipboard=unnamedplus
" Remove extra line
set cmdheight=1
" Set pandoc preview program
let g:pandoc_preview_pdf_cmd = "zathura"
" Case insensitive seatch
set ignorecase
set smartcase
" Format on paste
set paste
" Automatically change working directory
set autochdir
" Nerdtree settings
let NERDTreeMinimalUI = 1 "remove press ? for help"
let NERDTreeAutoDeleteBuffer = 1 " delete buffer when file is deleted
let NERDTreeQuitOnOpen = 1 " close nerdtree when opening file
let NERDTreeDirArrows = 1

View file

@ -0,0 +1,5 @@
" Run multiple wikis "
let g:vimwiki_list = [
\{'path': '~/Documents/VimWiki/personal.wiki'},
\{'path': '~/Documents/VimWiki/tech.wiki'}
\]

View file

@ -0,0 +1,18 @@
{%@@ if profile == "Mirkwood" @@%}
" Wayland clipboard provider that strips carriage returns (GTK3 issue).
" This is needed because currently there's an issue where GTK3 applications on
" Wayland contain carriage returns at the end of the lines (this is a root
" issue that needs to be fixed).
let g:clipboard = {
\ 'name': 'wayland-strip-carriage',
\ 'copy': {
\ '+': 'wl-copy --foreground --type text/plain',
\ '*': 'wl-copy --foreground --type text/plain --primary',
\ },
\ 'paste': {
\ '+': {-> systemlist('wl-paste --no-newline | tr -d "\r"')},
\ '*': {-> systemlist('wl-paste --no-newline --primary | tr -d "\r"')},
\ },
\ 'cache_enabled': 1,
\ }
{%@@ endif @@%}

View file

@ -0,0 +1,3 @@
for f in split(glob('~/.config/nvim/conf.d/*.vim'), '\n')
exe 'source' f
endfor