~alexcleac/dotfiles unlisted

dotfiles/init.vim -rw-r--r-- 1.6 KiB
f52e5499Alex Cleac [newsboat] Improva download speed 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
call plug#begin('~/.config/nvim/plugged')
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'

Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
Plug 'vimwiki/vimwiki'
Plug 'jpalardy/vim-slime'

Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'elixir-editors/vim-elixir'
Plug 'tkztmk/vim-vala'
Plug 'ElmCast/elm-vim'

call plug#end()

colorscheme slate

let mapleader = ","

nnoremap <silent> <leader>ce :tabnew ~/.config/nvim/init.vim<CR>
nnoremap <silent> <leader>d :noh<CR>
nnoremap <silent> <leader>t :NERDTreeToggle<CR>

" inoremap [ (
" inoremap ] )
" inoremap [[ [
" inoremap ]] ]

command! W normal :w<CR>
command! Wq normal :wq<CR>
command! Q normal :q!<CR>
command! Qa normal :qa!<CR>

au BufWritePost *.py exe "!flake8 %"
au BufWritePost *.lua exe "!lualint %"
au BufReadPre *.c set et sts=2 sw=2
au Syntax haskell set et sts=2 sw=2
au BufReadPre *.md,*.wiki,*.txt,*.rst set et sts=2 sw=2

au BufWritePre * %s/\ \+$//ge

set et sts=2 sw=2

set linebreak
set undofile
set number

function! AttachProjectConfig()
  if filereadable(".vimconfig")
    source .vimconfig
  endif
endfunction
if !exists("project_config_attach")
  let project_config_attach = 1
  autocmd VimEnter * call AttachProjectConfig()
endif

let g:vimwiki_list = [{'path': '~/vimwiki',
			\ 'syntax': 'markdown', 'ext': '.md'}]


function! RipGrep()
	let command = ':!rg -w -e "' . getreg('/') . '" -C 2'
	execute command
endfunction
command! RG call RipGrep()

function! ReadLine()
	let command = ':!espeak -s 215 "' . getline('.') . ' "'
	execute command
endfunction
command! ReadLine call ReadLine()
nnoremap <silent> <leader>r :call ReadLine()