mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-21 02:55:09 +02:00
lots of good stuff
This commit is contained in:
parent
dd8fa942f4
commit
5977c59876
10 changed files with 60 additions and 47 deletions
|
@ -1,21 +1,11 @@
|
||||||
" distinct highlight current, first and last match when searching
|
" Turn spellcheck on for markdown files
|
||||||
function! HLCurrent() abort
|
augroup auto_spellcheck
|
||||||
if exists("currmatch")
|
autocmd BufNewFile,BufRead *.md setlocal spell
|
||||||
call matchdelete(currmatch)
|
augroup END
|
||||||
endif
|
|
||||||
" only on cursor
|
" Remove trailing whitespaces automatically before save
|
||||||
let patt = '\c\%#'.@/
|
augroup strip_ws
|
||||||
" check prev and next match
|
autocmd BufWritePre * call utils#stripTrailingWhitespaces()
|
||||||
let prevmatch = search(@/, 'bWn')
|
augroup END
|
||||||
let nextmatch = search(@/, 'Wn')
|
|
||||||
" if on first or last match
|
|
||||||
if prevmatch == 0 || nextmatch == 0
|
|
||||||
let currmatch = matchadd('EdgeSearch', patt, 101)
|
|
||||||
else
|
|
||||||
let currmatch = matchadd('IncSearch', patt, 101)
|
|
||||||
endif
|
|
||||||
redraw
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nnoremap <silent> n n:call HLCurrent()<cr>
|
|
||||||
nnoremap <silent> N N:call HLCurrent()<cr>
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
" set leader key
|
|
||||||
"map <Space> <Leader>
|
|
||||||
"nmap <space> <leader>
|
|
||||||
set iskeyword+=- " treat dash separated words as a word text object"
|
set iskeyword+=- " treat dash separated words as a word text object"
|
||||||
|
set formatoptions-=cro " Stop newline continution of comments
|
||||||
|
|
||||||
if !exists('g:vscode')
|
if !exists('g:vscode')
|
||||||
syntax enable " Enables syntax highlighing
|
syntax enable " Enables syntax highlighing
|
||||||
|
@ -35,7 +33,6 @@ if !exists('g:vscode')
|
||||||
set signcolumn=yes " Always show the signcolumn, otherwise it would shift the text each time
|
set signcolumn=yes " Always show the signcolumn, otherwise it would shift the text each time
|
||||||
set updatetime=300 " Faster completion
|
set updatetime=300 " Faster completion
|
||||||
set timeoutlen=100 " By default timeoutlen is 1000 ms
|
set timeoutlen=100 " By default timeoutlen is 1000 ms
|
||||||
set formatoptions-=cro " Stop newline continution of comments
|
|
||||||
set clipboard=unnamedplus " Copy paste between vim and everything else
|
set clipboard=unnamedplus " Copy paste between vim and everything else
|
||||||
set incsearch
|
set incsearch
|
||||||
set guifont=Hack\ Nerd\ Font
|
set guifont=Hack\ Nerd\ Font
|
||||||
|
@ -44,7 +41,7 @@ if !exists('g:vscode')
|
||||||
" set autochdir " Your working directory will always be the same as your working directory
|
" set autochdir " Your working directory will always be the same as your working directory
|
||||||
" set foldcolumn=2 " Folding abilities
|
" set foldcolumn=2 " Folding abilities
|
||||||
|
|
||||||
au! BufWritePost $MYVIMRC source % " auto source when writing to init.vm alternatively you can run :source $MYVIMRC
|
" au! BufWritePost $MYVIMRC source % " auto source when writing to init.vm alternatively you can run :source $MYVIMRC
|
||||||
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
||||||
|
|
||||||
|
|
||||||
|
|
17
init.vim
17
init.vim
|
@ -31,20 +31,11 @@ else
|
||||||
source $HOME/.config/nvim/plug-config/sneak.vim
|
source $HOME/.config/nvim/plug-config/sneak.vim
|
||||||
source $HOME/.config/nvim/plug-config/goyo.vim
|
source $HOME/.config/nvim/plug-config/goyo.vim
|
||||||
source $HOME/.config/nvim/plug-config/vim-rooter.vim
|
source $HOME/.config/nvim/plug-config/vim-rooter.vim
|
||||||
"source $HOME/.config/nvim/plug-config/easymotion.vim
|
|
||||||
source $HOME/.config/nvim/plug-config/start-screen.vim
|
source $HOME/.config/nvim/plug-config/start-screen.vim
|
||||||
source $HOME/.config/nvim/plug-config/signify.vim
|
source $HOME/.config/nvim/plug-config/signify.vim
|
||||||
|
source $HOME/.config/nvim/plug-config/closetags.vim
|
||||||
|
source $HOME/.config/nvim/plug-config/floaterm.vim
|
||||||
|
source $HOME/.config/nvim/plug-config/vista.vim
|
||||||
luafile $HOME/.config/nvim/lua/plug-colorizer.lua
|
luafile $HOME/.config/nvim/lua/plug-colorizer.lua
|
||||||
|
"source $HOME/.config/nvim/plug-config/easymotion.vim
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let g:floaterm_wintype='normal'
|
|
||||||
let g:floaterm_height=6
|
|
||||||
let g:floaterm_keymap_new = '<F7>'
|
|
||||||
let g:floaterm_keymap_prev = '<F8>'
|
|
||||||
let g:floaterm_keymap_next = '<F9>'
|
|
||||||
let g:floaterm_keymap_toggle = '<F12>'
|
|
||||||
|
|
||||||
let g:pear_tree_smart_openers = 1
|
|
||||||
let g:pear_tree_smart_closers = 1
|
|
||||||
let g:pear_tree_smart_backspace = 1
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
" Leader key
|
" Leader key
|
||||||
let mapleader=" "
|
let mapleader=" "
|
||||||
let localleader=" "
|
" let localleader=" "
|
||||||
nnoremap <Space> <Nop>
|
nnoremap <Space> <Nop>
|
||||||
|
|
||||||
" Better indenting
|
" Better indenting
|
||||||
|
|
|
@ -85,6 +85,7 @@ let g:which_key_map.l = {
|
||||||
\ 't' : ['<Plug>(coc-type-definition)' , 'type definition'],
|
\ 't' : ['<Plug>(coc-type-definition)' , 'type definition'],
|
||||||
\ 'u' : [':CocListResume' , 'resume list'],
|
\ 'u' : [':CocListResume' , 'resume list'],
|
||||||
\ 'U' : [':CocUpdate' , 'update CoC'],
|
\ 'U' : [':CocUpdate' , 'update CoC'],
|
||||||
|
\ 'v' : [':Vista!!' , 'tag viewer'],
|
||||||
\ 'z' : [':CocDisable' , 'disable CoC'],
|
\ 'z' : [':CocDisable' , 'disable CoC'],
|
||||||
\ 'Z' : [':CocEnable' , 'enable CoC'],
|
\ 'Z' : [':CocEnable' , 'enable CoC'],
|
||||||
\ }
|
\ }
|
||||||
|
@ -93,12 +94,13 @@ let g:which_key_map.l = {
|
||||||
" t is for toggle
|
" t is for toggle
|
||||||
let g:which_key_map.t = {
|
let g:which_key_map.t = {
|
||||||
\ 'name' : '+toggle' ,
|
\ 'name' : '+toggle' ,
|
||||||
|
\ 'c' : [':ColorizerToggle' , 'colorizer'],
|
||||||
\ 'e' : [':CocCommand explorer' , 'explorer'],
|
\ 'e' : [':CocCommand explorer' , 'explorer'],
|
||||||
\ 'n' : [':set nonumber!' , 'line-numbers'],
|
\ 'n' : [':set nonumber!' , 'line-numbers'],
|
||||||
\ 'r' : [':set norelativenumber!' , 'rel-line-numbers'],
|
\ 'r' : [':set norelativenumber!' , 'relative line nums'],
|
||||||
\ 's' : [':let @/ = ""' , 'remove-search-highlight'],
|
\ 's' : [':let @/ = ""' , 'remove search highlight'],
|
||||||
\ 'c' : [':ColorizerToggle' , 'colorizer'],
|
|
||||||
\ 't' : [':FloatermToggle' , 'terminal'],
|
\ 't' : [':FloatermToggle' , 'terminal'],
|
||||||
|
\ 'v' : [':Vista!!' , 'tag viewer'],
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
|
||||||
|
|
4
plug-config/closetags.vim
Normal file
4
plug-config/closetags.vim
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
let g:closetag_filenames = '*.html,*.xhtml,*.phtml'
|
||||||
|
let g:closetag_xhtml_filenames = '*.xhtml,*.jsx,*.js'
|
||||||
|
let g:closetag_filetypes = 'html,xhtml,phtml,javascript'
|
||||||
|
|
8
plug-config/floaterm.vim
Normal file
8
plug-config/floaterm.vim
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
" let g:floaterm_wintype='normal'
|
||||||
|
" let g:floaterm_height=6
|
||||||
|
|
||||||
|
let g:floaterm_keymap_toggle = '<F1>'
|
||||||
|
let g:floaterm_keymap_next = '<F2>'
|
||||||
|
let g:floaterm_keymap_prev = '<F3>'
|
||||||
|
let g:floaterm_keymap_new = '<F4>'
|
|
@ -47,10 +47,17 @@ command! -bang -nargs=? -complete=dir Files
|
||||||
|
|
||||||
|
|
||||||
" Get text in files with Rg
|
" Get text in files with Rg
|
||||||
|
" command! -bang -nargs=* Rg
|
||||||
|
" \ call fzf#vim#grep(
|
||||||
|
" \ "rg --column --line-number --no-heading --color=always --smart-case --glob '!.git/**' ".shellescape(<q-args>), 1,
|
||||||
|
|
||||||
|
" Make Ripgrep ONLY search file contents and not filenames
|
||||||
command! -bang -nargs=* Rg
|
command! -bang -nargs=* Rg
|
||||||
\ call fzf#vim#grep(
|
\ call fzf#vim#grep(
|
||||||
\ "rg --column --line-number --no-heading --color=always --smart-case --glob '!.git/**' ".shellescape(<q-args>), 1,
|
\ 'rg --column --line-number --hidden --smart-case --no-heading --color=always '.shellescape(<q-args>), 1,
|
||||||
\ fzf#vim#with_preview(), <bang>0)
|
\ <bang>0 ? fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'up:60%')
|
||||||
|
\ : fzf#vim#with_preview({'options': '--delimiter : --nth 4.. -e'}, 'right:50%', '?'),
|
||||||
|
\ <bang>0) \ fzf#vim#with_preview(), <bang>0)
|
||||||
|
|
||||||
" Ripgrep advanced
|
" Ripgrep advanced
|
||||||
function! RipgrepFzf(query, fullscreen)
|
function! RipgrepFzf(query, fullscreen)
|
||||||
|
|
9
plug-config/vista.vim
Normal file
9
plug-config/vista.vim
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
let g:vista_default_executive = 'coc'
|
||||||
|
let g:vista_fzf_preview = ['right:50%']
|
||||||
|
|
||||||
|
let g:vista#renderer#enable_icon = 1
|
||||||
|
|
||||||
|
let g:vista#renderer#icons = {
|
||||||
|
\ "function": "\uf794",
|
||||||
|
\ "variable": "\uf71b",
|
||||||
|
\ }
|
|
@ -22,6 +22,8 @@ call plug#begin('~/.config/nvim/autoload/plugged')
|
||||||
Plug 'tpope/vim-commentary'
|
Plug 'tpope/vim-commentary'
|
||||||
" Have the file system follow you around
|
" Have the file system follow you around
|
||||||
Plug 'airblade/vim-rooter'
|
Plug 'airblade/vim-rooter'
|
||||||
|
" auto set indent settings
|
||||||
|
Plug 'tpope/vim-sleuth'
|
||||||
|
|
||||||
if exists('g:vscode')
|
if exists('g:vscode')
|
||||||
" Easy motion for VSCode
|
" Easy motion for VSCode
|
||||||
|
@ -40,8 +42,9 @@ call plug#begin('~/.config/nvim/autoload/plugged')
|
||||||
" Cool Icons
|
" Cool Icons
|
||||||
Plug 'ryanoasis/vim-devicons'
|
Plug 'ryanoasis/vim-devicons'
|
||||||
" Auto pairs for '(' '[' '{'
|
" Auto pairs for '(' '[' '{'
|
||||||
" Plug 'jiangmiao/auto-pairs'
|
Plug 'jiangmiao/auto-pairs'
|
||||||
Plug 'tmsvg/pear-tree'
|
" Closetags
|
||||||
|
Plug 'alvan/vim-closetag'
|
||||||
" Themes
|
" Themes
|
||||||
Plug 'christianchiarulli/onedark.vim'
|
Plug 'christianchiarulli/onedark.vim'
|
||||||
" Plug 'kaicataldo/material.vim'
|
" Plug 'kaicataldo/material.vim'
|
||||||
|
@ -68,7 +71,7 @@ call plug#begin('~/.config/nvim/autoload/plugged')
|
||||||
Plug 'mhinz/vim-startify'
|
Plug 'mhinz/vim-startify'
|
||||||
" Vista
|
" Vista
|
||||||
Plug 'liuchengxu/vista.vim'
|
Plug 'liuchengxu/vista.vim'
|
||||||
" Help
|
" See what keys do like in emacs
|
||||||
Plug 'liuchengxu/vim-which-key'
|
Plug 'liuchengxu/vim-which-key'
|
||||||
" Zen mode
|
" Zen mode
|
||||||
Plug 'junegunn/goyo.vim'
|
Plug 'junegunn/goyo.vim'
|
||||||
|
@ -78,6 +81,8 @@ call plug#begin('~/.config/nvim/autoload/plugged')
|
||||||
" Plug 'SirVer/ultisnips'
|
" Plug 'SirVer/ultisnips'
|
||||||
" Better Comments
|
" Better Comments
|
||||||
Plug 'jbgutierrez/vim-better-comments'
|
Plug 'jbgutierrez/vim-better-comments'
|
||||||
|
" Echo doc
|
||||||
|
" Plug 'Shougo/echodoc.vim'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue