mirror of
https://github.com/gryf/.vim.git
synced 2026-03-27 16:23:31 +01:00
Compare commits
4 Commits
7b5070ab3e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 585993537f | |||
| 6092e24242 | |||
| a55590f07c | |||
| 34d7979d62 |
84
vimrc
84
vimrc
@@ -64,11 +64,11 @@ Plug 'vim-scripts/mako.vim', { 'for': 'mako' }
|
|||||||
Plug 'vim-scripts/mako.vim--Torborg', { 'for': 'mako' }
|
Plug 'vim-scripts/mako.vim--Torborg', { 'for': 'mako' }
|
||||||
Plug 'vimwiki/vimwiki'
|
Plug 'vimwiki/vimwiki'
|
||||||
Plug 'will133/vim-dirdiff'
|
Plug 'will133/vim-dirdiff'
|
||||||
|
Plug 'rickhowe/diffchar.vim'
|
||||||
Plug 'thinca/vim-localrc'
|
Plug 'thinca/vim-localrc'
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
" }}}
|
" }}}
|
||||||
" }}}
|
|
||||||
|
|
||||||
filetype plugin indent on "turn plugins/indent on
|
filetype plugin indent on "turn plugins/indent on
|
||||||
syntax on "Turn syntax highlighting on
|
syntax on "Turn syntax highlighting on
|
||||||
@@ -260,6 +260,22 @@ function s:SetMarkdownSettings() "{{{2
|
|||||||
|
|
||||||
map <S-F5> :ShowInBrowser<CR>
|
map <S-F5> :ShowInBrowser<CR>
|
||||||
|
|
||||||
|
" https://github.com/jszakmeister/markdown2ctags
|
||||||
|
let g:tagbar_type_markdown = {
|
||||||
|
\ 'ctagstype': 'markdown',
|
||||||
|
\ 'ctagsbin' : 'markdown2ctags.py',
|
||||||
|
\ 'ctagsargs' : '-f - --sort=yes --sro=»',
|
||||||
|
\ 'kinds' : [
|
||||||
|
\ 's:sections',
|
||||||
|
\ 'i:images'
|
||||||
|
\ ],
|
||||||
|
\ 'sro' : '»',
|
||||||
|
\ 'kind2scope' : {
|
||||||
|
\ 's' : 'section',
|
||||||
|
\ },
|
||||||
|
\ 'sort': 0,
|
||||||
|
\ }
|
||||||
|
|
||||||
" autocmd BufWritePost *.md :silent make
|
" autocmd BufWritePost *.md :silent make
|
||||||
endfunction
|
endfunction
|
||||||
"}}}
|
"}}}
|
||||||
@@ -343,10 +359,19 @@ function s:SetRestSettings() "{{{2
|
|||||||
endfunction
|
endfunction
|
||||||
"}}}
|
"}}}
|
||||||
function s:SetVimwikiSettings() "{{{2
|
function s:SetVimwikiSettings() "{{{2
|
||||||
|
let b:ale_enabled=0
|
||||||
setlocal spell
|
setlocal spell
|
||||||
map <F5> :Vimwiki2HTML<CR>
|
setlocal makeprg=vw2html\ -q\ \"%\"
|
||||||
map <S-F5> :Vimwiki2HTMLBrowse<CR>
|
map <S-F5> :Vimwiki2HTMLBrowse<CR>
|
||||||
map <C-F5> :VimwikiAll2HTML<CR>
|
map <C-F5> :PyVimwikiAll2Html<CR>
|
||||||
|
|
||||||
|
let g:tagbar_type_vimwiki = {
|
||||||
|
\ 'ctagstype' : 'vimwiki',
|
||||||
|
\ 'kinds' : [
|
||||||
|
\ 'h:header',
|
||||||
|
\ ],
|
||||||
|
\ 'sort' : 0
|
||||||
|
\ }
|
||||||
endfunction
|
endfunction
|
||||||
"}}}
|
"}}}
|
||||||
function s:SetGitcommitSettings() "{{{2
|
function s:SetGitcommitSettings() "{{{2
|
||||||
@@ -355,8 +380,8 @@ function s:SetGitcommitSettings() "{{{2
|
|||||||
endfunction
|
endfunction
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
autocmd BufRead *.mako set filetype=mako
|
autocmd BufRead,BufNewFile *.mako set filetype=mako
|
||||||
autocmd BufRead *.ass, *asm set filetype=kickass
|
autocmd BufRead,BufNewFile *.ass, *asm set filetype=kickass
|
||||||
|
|
||||||
" make the current line highlighted only on current window
|
" make the current line highlighted only on current window
|
||||||
autocmd WinEnter * setlocal cursorline
|
autocmd WinEnter * setlocal cursorline
|
||||||
@@ -401,6 +426,7 @@ endif
|
|||||||
"Ale {{{2
|
"Ale {{{2
|
||||||
let g:ale_sh_bashate_executable="bashate -i E006"
|
let g:ale_sh_bashate_executable="bashate -i E006"
|
||||||
let g:ale_virtualtext_cursor=0
|
let g:ale_virtualtext_cursor=0
|
||||||
|
let g:ale_linters={'python': ['ruff']}
|
||||||
"}}}
|
"}}}
|
||||||
"KickAssembler {{{2
|
"KickAssembler {{{2
|
||||||
let g:kickass_path = '/opt/KickAssembler/KickAss.jar'
|
let g:kickass_path = '/opt/KickAssembler/KickAss.jar'
|
||||||
@@ -522,11 +548,17 @@ let g:tagbar_type_vimwiki = {
|
|||||||
" Note: see statusline settings for status bar tag conf
|
" Note: see statusline settings for status bar tag conf
|
||||||
"}}}
|
"}}}
|
||||||
"VimWIKI {{{2
|
"VimWIKI {{{2
|
||||||
let g:vimwiki_list = [{'path': '~/vimwiki/',
|
let g:vimwiki_list = [
|
||||||
|
\ {'path': '~/vimwiki/',
|
||||||
\ 'template_path': '~/vimwiki/',
|
\ 'template_path': '~/vimwiki/',
|
||||||
|
\ 'path_html': '~/vimwiki_html_vw',
|
||||||
\ 'template_default': 'default',
|
\ 'template_default': 'default',
|
||||||
\ 'template_ext': '.tpl',
|
\ 'template_ext': '.tpl',
|
||||||
\ 'css_name': 'vimwiki_style.css'}]
|
\ 'css_name': 'css/main.css'}
|
||||||
|
\ ]
|
||||||
|
let g:vimwiki_valid_html_tags = 'b,i,s,u,sub,sup,kbd,br,hr,span'
|
||||||
|
" Do not make syntax=vimwiki for markdown files, ignore md as vimwiki flavor
|
||||||
|
let g:vimwiki_ext2syntax = {}
|
||||||
"redefine tab key for vimwiki
|
"redefine tab key for vimwiki
|
||||||
map <Leader>wn <Plug>VimwikiNextWord
|
map <Leader>wn <Plug>VimwikiNextWord
|
||||||
map <Leader>wp <Plug>VimwikiPrevWord
|
map <Leader>wp <Plug>VimwikiPrevWord
|
||||||
@@ -748,8 +780,46 @@ function s:CycleDiffAlgorithm()
|
|||||||
echom 'Set diff algorithm to: ' . split(l:nextalgo, ':')[1]
|
echom 'Set diff algorithm to: ' . split(l:nextalgo, ':')[1]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Convert wiki files to HTML
|
||||||
|
command -bang -nargs=? PyVimwikiAll2Html call ConvertVimwikiToHtml(<bang>0, 0)
|
||||||
|
command -bang -nargs=? PyVimwikiHtml call ConvertVimwikiToHtml(<bang>0, 1)
|
||||||
|
function ConvertVimwikiToHtml(forced, currentfile)
|
||||||
|
if &ft != 'vimwiki'
|
||||||
|
" not vimwiki file, do nothing
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let l:command = 'vw2html -q'
|
||||||
|
if a:forced == 1
|
||||||
|
let l:command = l:command . ' -f'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:currentfile == 1
|
||||||
|
let l:command = l:command . ' ' . bufname("%")
|
||||||
|
endif
|
||||||
|
|
||||||
|
call system(l:command)
|
||||||
|
echom "Conversion to HTML done with command: " . l:command
|
||||||
|
endfunction
|
||||||
|
|
||||||
"write files as a root using sudo
|
"write files as a root using sudo
|
||||||
command W w !sudo tee "%" > /dev/null
|
command W w !sudo tee "%" > /dev/null
|
||||||
|
|
||||||
|
" stolen and modified from reddit, user and post doesn't exists enymore
|
||||||
|
function! InsertVimwikiLink()
|
||||||
|
" TODO: hardcoded, perhaps make some variables to handle this, or use
|
||||||
|
" g:vimwiki_list to guess the wiki location and default extension.
|
||||||
|
let l:wikilocation = '~/vimwiki'
|
||||||
|
let l:wikiext = '.wiki'
|
||||||
|
let files = systemlist("find " . l:wikilocation . " -name '*" . l:wikiext .
|
||||||
|
\ "' | sed 's#.*" . l:wikilocation[2:] .
|
||||||
|
\ "/##; s/\\" . l:wikiext . "$//'")
|
||||||
|
let choice = fzf#run(fzf#wrap(
|
||||||
|
\ {'source': files,
|
||||||
|
\ 'sink*': { lines -> execute("normal! a[[" . lines[0] . "]]") }
|
||||||
|
\}))
|
||||||
|
endfunction
|
||||||
|
nnoremap <leader>wl :call InsertVimwikiLink()<CR>
|
||||||
|
inoremap <C-x><C-w> <Esc>:call InsertVimwikiLink()<CR>
|
||||||
"}}}
|
"}}}
|
||||||
" GUI: detect graphics mode, set colorscheme {{{
|
" GUI: detect graphics mode, set colorscheme {{{
|
||||||
if has('gui_running')
|
if has('gui_running')
|
||||||
|
|||||||
Reference in New Issue
Block a user