usefull arrow keys
This commit is contained in:
parent
3e6fb797d7
commit
acd6b78103
|
@ -41,6 +41,23 @@ noremap OO O<ESC>
|
||||||
nmap H ^
|
nmap H ^
|
||||||
nmap L $
|
nmap L $
|
||||||
|
|
||||||
|
" usefull functions for arrow keys
|
||||||
|
" (and force the user to use hjkl)
|
||||||
|
|
||||||
|
" right/left to add/remove a tab in the beginning of the line.
|
||||||
|
nmap <Left> <<
|
||||||
|
nmap <Right> >>
|
||||||
|
" same for visual mode (plus reselecting stuff for visual mode)
|
||||||
|
vmap <Left> <gv
|
||||||
|
vmap <Right> >gv
|
||||||
|
|
||||||
|
" up and down move lines up and down
|
||||||
|
nmap <Up> :m -2<CR>
|
||||||
|
nmap <Down> :m +1<CR>
|
||||||
|
" same for visual mode (plus reselecting stuff for visual mode)
|
||||||
|
vmap <Up> :m -2<CR>
|
||||||
|
vmap <Down> :m +1<CR>
|
||||||
|
|
||||||
" hit f3 to toggle search highlighting"
|
" hit f3 to toggle search highlighting"
|
||||||
nnoremap <F3> :set hlsearch!<CR>
|
nnoremap <F3> :set hlsearch!<CR>
|
||||||
|
|
||||||
|
|
|
@ -41,9 +41,19 @@ Plug 'nvim-tree/nvim-web-devicons'
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
Plug 'junegunn/fzf.vim'
|
Plug 'junegunn/fzf.vim'
|
||||||
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' }
|
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' }
|
||||||
|
runtime markdownpreview.vim
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
|
" no default mappings for vim smoothie (fancy scrolling)
|
||||||
|
let g:smoothie_no_default_mappings = 1
|
||||||
|
|
||||||
|
" smooth scrolling with J and K instead of <S-Up> and <S-Down>
|
||||||
|
nnoremap <unique> J <cmd>call smoothie#do("\<C-D>") <CR>
|
||||||
|
vnoremap <unique> J <cmd>call smoothie#do("\<C-D>") <CR>
|
||||||
|
nnoremap <unique> K <cmd>call smoothie#do("\<C-U>") <CR>
|
||||||
|
vnoremap <unique> K <cmd>call smoothie#do("\<C-U>") <CR>
|
||||||
|
|
||||||
" Use <Tab> and <S-Tab> to navigate through popup menu"
|
" Use <Tab> and <S-Tab> to navigate through popup menu"
|
||||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||||
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||||
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
" set to 1, nvim will open the preview window after entering the markdown buffer
|
||||||
|
" default: 0
|
||||||
|
let g:mkdp_auto_start = 0
|
||||||
|
|
||||||
|
" set to 1, the nvim will auto close current preview window when change
|
||||||
|
" from markdown buffer to another buffer
|
||||||
|
" default: 1
|
||||||
|
let g:mkdp_auto_close = 1
|
||||||
|
|
||||||
|
" set to 1, the vim will refresh markdown when save the buffer or
|
||||||
|
" leave from insert mode, default 0 is auto refresh markdown as you edit or
|
||||||
|
" move the cursor
|
||||||
|
" default: 0
|
||||||
|
let g:mkdp_refresh_slow = 0
|
||||||
|
|
||||||
|
" set to 1, the MarkdownPreview command can be use for all files,
|
||||||
|
" by default it can be use in markdown file
|
||||||
|
" default: 0
|
||||||
|
let g:mkdp_command_for_global = 0
|
||||||
|
|
||||||
|
" set to 1, preview server available to others in your network
|
||||||
|
" by default, the server listens on localhost (127.0.0.1)
|
||||||
|
" default: 0
|
||||||
|
let g:mkdp_open_to_the_world = 0
|
||||||
|
|
||||||
|
" use custom IP to open preview page
|
||||||
|
" useful when you work in remote vim and preview on local browser
|
||||||
|
" more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9
|
||||||
|
" default empty
|
||||||
|
let g:mkdp_open_ip = ''
|
||||||
|
|
||||||
|
" specify browser to open preview page
|
||||||
|
" for path with space
|
||||||
|
" valid: `/path/with\ space/xxx`
|
||||||
|
" invalid: `/path/with\\ space/xxx`
|
||||||
|
" default: ''
|
||||||
|
let g:mkdp_browser = ''
|
||||||
|
|
||||||
|
" set to 1, echo preview page url in command line when open preview page
|
||||||
|
" default is 0
|
||||||
|
let g:mkdp_echo_preview_url = 0
|
||||||
|
|
||||||
|
" a custom vim function name to open preview page
|
||||||
|
" this function will receive url as param
|
||||||
|
" default is empty
|
||||||
|
let g:mkdp_browserfunc = ''
|
||||||
|
|
||||||
|
" options for markdown render
|
||||||
|
" mkit: markdown-it options for render
|
||||||
|
" katex: katex options for math
|
||||||
|
" uml: markdown-it-plantuml options
|
||||||
|
" maid: mermaid options
|
||||||
|
" disable_sync_scroll: if disable sync scroll, default 0
|
||||||
|
" sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle'
|
||||||
|
" middle: mean the cursor position alway show at the middle of the preview page
|
||||||
|
" top: mean the vim top viewport alway show at the top of the preview page
|
||||||
|
" relative: mean the cursor position alway show at the relative positon of the preview page
|
||||||
|
" hide_yaml_meta: if hide yaml metadata, default is 1
|
||||||
|
" sequence_diagrams: js-sequence-diagrams options
|
||||||
|
" content_editable: if enable content editable for preview page, default: v:false
|
||||||
|
" disable_filename: if disable filename header for preview page, default: 0
|
||||||
|
let g:mkdp_preview_options = {
|
||||||
|
\ 'mkit': {},
|
||||||
|
\ 'katex': {},
|
||||||
|
\ 'uml': {},
|
||||||
|
\ 'maid': {},
|
||||||
|
\ 'disable_sync_scroll': 0,
|
||||||
|
\ 'sync_scroll_type': 'middle',
|
||||||
|
\ 'hide_yaml_meta': 1,
|
||||||
|
\ 'sequence_diagrams': {},
|
||||||
|
\ 'flowchart_diagrams': {},
|
||||||
|
\ 'content_editable': v:false,
|
||||||
|
\ 'disable_filename': 0,
|
||||||
|
\ 'toc': {}
|
||||||
|
\ }
|
||||||
|
|
||||||
|
" use a custom markdown style must be absolute path
|
||||||
|
" like '/Users/username/markdown.css' or expand('~/markdown.css')
|
||||||
|
let g:mkdp_markdown_css = ''
|
||||||
|
|
||||||
|
" use a custom highlight style must absolute path
|
||||||
|
" like '/Users/username/highlight.css' or expand('~/highlight.css')
|
||||||
|
let g:mkdp_highlight_css = ''
|
||||||
|
|
||||||
|
" use a custom port to start server or empty for random
|
||||||
|
let g:mkdp_port = ''
|
||||||
|
|
||||||
|
" preview page title
|
||||||
|
" ${name} will be replace with the file name
|
||||||
|
let g:mkdp_page_title = '「${name}」'
|
||||||
|
|
||||||
|
" recognized filetypes
|
||||||
|
" these filetypes will have MarkdownPreview... commands
|
||||||
|
let g:mkdp_filetypes = ['markdown']
|
||||||
|
|
||||||
|
" set default theme (dark or light)
|
||||||
|
" By default the theme is define according to the preferences of the system
|
||||||
|
let g:mkdp_theme = 'dark'
|
21
home/.vimrc
21
home/.vimrc
|
@ -29,6 +29,27 @@ set shortmess+=c
|
||||||
noremap oo o<ESC>
|
noremap oo o<ESC>
|
||||||
noremap OO O<ESC>
|
noremap OO O<ESC>
|
||||||
|
|
||||||
|
" H and L for end and beginning
|
||||||
|
nmap H ^
|
||||||
|
nmap L $
|
||||||
|
|
||||||
|
" usefull functions for arrow keys
|
||||||
|
" (and force the user to use hjkl)
|
||||||
|
|
||||||
|
" right/left to add/remove a tab in the beginning of the line.
|
||||||
|
nmap <Left> <<
|
||||||
|
nmap <Right> >>
|
||||||
|
" same for visual mode (plus reselecting stuff for visual mode)
|
||||||
|
vmap <Left> <gv
|
||||||
|
vmap <Right> >gv
|
||||||
|
|
||||||
|
" up and down move lines up and down
|
||||||
|
nmap <Up> :m -1<CR>
|
||||||
|
nmap <Down> :m +1<CR>
|
||||||
|
" same for visual mode (plus reselecting stuff for visual mode)
|
||||||
|
vmap <Up> :m -1<CR>
|
||||||
|
vmap <Down> :m +1<CR>
|
||||||
|
|
||||||
" hit f3 to toggle search highlighting"
|
" hit f3 to toggle search highlighting"
|
||||||
nnoremap <F3> :set hlsearch!<CR>
|
nnoremap <F3> :set hlsearch!<CR>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue