remove local settings
This commit is contained in:
parent
183f2daafc
commit
e0dcc03d78
2 changed files with 11 additions and 79 deletions
30
plug.vim
30
plug.vim
|
@ -6,33 +6,5 @@ if !filereadable($HOME.'/.vim/autoload/plug.vim')
|
|||
echom 'DONE! You may need to :PlugInstall to install listed plugins'
|
||||
endif
|
||||
|
||||
" plugin
|
||||
call plug#begin('~/.vim/plugged')
|
||||
" markdown syntax
|
||||
Plug 'plasticboy/vim-markdown'
|
||||
let g:vim_markdown_new_list_item_indent = 0
|
||||
let g:vim_markdown_math = 1
|
||||
|
||||
" markdown preview
|
||||
Plug 'iamcco/markdown-preview.nvim', {'do': 'cd app & yarn install'}
|
||||
let g:mkdp_auto_start = 0
|
||||
let g:mkdp_auto_close = 0
|
||||
let g:mkdp_preview_options = {
|
||||
\ 'katex': {
|
||||
\ 'macros': {
|
||||
\ '\s': '\square',
|
||||
\ },
|
||||
\ },
|
||||
\}
|
||||
|
||||
" ale
|
||||
Plug 'dense-analysis/ale'
|
||||
let g:ale_sign_error = '>>'
|
||||
let g:ale_sign_warning = '--'
|
||||
let g:ale_sign_column_always = 1
|
||||
let g:ale_completion_enabled = 1
|
||||
let g:ale_linters = {
|
||||
\ 'cpp': ['gcc'],
|
||||
\ 'swift': ['sourcekitlsp'],
|
||||
\ }
|
||||
call plug#end()
|
||||
" call plug#end()
|
||||
|
|
60
vimrc
60
vimrc
|
@ -1,3 +1,5 @@
|
|||
let sfile = expand('<sfile>')
|
||||
|
||||
" map-leader
|
||||
if !exists('mapleader')
|
||||
let mapleader='q'
|
||||
|
@ -9,77 +11,39 @@ if !exists('maplocalleader')
|
|||
noremap <localleader> <nop>
|
||||
endif
|
||||
inoremap jk <ESC>
|
||||
inoremap Jk <ESC>
|
||||
inoremap JK <ESC>
|
||||
" file
|
||||
" save
|
||||
nnoremap <C-S> :w<CR>
|
||||
inoremap <C-S> <ESC>:w<CR>
|
||||
" copy
|
||||
nnoremap <leader>C :w !pbcopy<CR><CR>
|
||||
nnoremap <leader>C :%y*<CR>
|
||||
" tab edit
|
||||
nnoremap <leader>e :tabe
|
||||
nnoremap <leader>vv :tabe $HOME/.vim/sup39/vimrc<CR>
|
||||
nnoremap <leader>vp :tabe $HOME/.vim/sup39/plug.vim<CR>
|
||||
nnoremap <leader>vd :tabe $HOME/.vim/sup39/
|
||||
execute 'nnoremap <leader>vv :tabe '.sfile.'<CR>'
|
||||
nnoremap <leader>V :tabe $MYVIMRC<CR>
|
||||
" search
|
||||
nnoremap / /\v
|
||||
nnoremap ? ?\v
|
||||
nnoremap <leader>sl :s/\v
|
||||
nnoremap <leader>se :.,$s/\v
|
||||
nnoremap <leader>ss :%s/\v
|
||||
nnoremap <leader>hh :set hlsearch! incsearch!<CR>
|
||||
nnoremap <leader>hc :nohlsearch<CR>
|
||||
" ale
|
||||
nnoremap <leader>r :ALERename<CR>
|
||||
nnoremap <leader>n :ALENext<CR>
|
||||
nnoremap <leader>p :ALEPrevious<CR>
|
||||
nnoremap <leader><space> :ALEHover<CR>
|
||||
nnoremap <leader>db :ALEGoToDefinition -tab<CR>
|
||||
nnoremap <leader>dm :ALEGoToDefinition<CR>
|
||||
nnoremap <leader>dl :ALEDetail<CR>
|
||||
" external
|
||||
nnoremap <leader>m :w<CR>:!make<CR>
|
||||
" syntax
|
||||
nnoremap <leader>S :syntax sync fromstart<CR>
|
||||
" debug
|
||||
nnoremap <leader>x :exe getline('.')<CR>
|
||||
nnoremap <leader>X :exe join(getline('.', '$'), "\n")<CR>
|
||||
nnoremap <leader>H :echo synIDattr(synID(line("."),col("."),1),"name")<CR>
|
||||
|
||||
" filetype-dependent
|
||||
augroup sup39_auto
|
||||
autocmd!
|
||||
" vim
|
||||
" source
|
||||
autocmd Filetype vim noremap <buffer> <localleader>s :w<CR>:so %<CR>
|
||||
" c, cpp
|
||||
" macro
|
||||
autocmd Filetype c,cpp noremap <buffer> <localleader>h
|
||||
\:call setline('.', toupper(substitute(@%, '\.', '_', 'g')))<CR>
|
||||
\yyI#ifndef <C-O>p#define <C-O>o<CR><CR><CR>#endif<ESC>kki
|
||||
autocmd Filetype c,cpp noremap <buffer> <localleader>i
|
||||
\:call setline('.',
|
||||
\'#include "'.substitute(@%, '\.\zsc\ze\(pp\)\?$', 'h', '').'"')<CR>o
|
||||
" abbr
|
||||
autocmd Filetype c,cpp iabbrev <buffer> #i #include
|
||||
autocmd Filetype c,cpp iabbrev <buffer> #I #include
|
||||
" markdown
|
||||
" plugin
|
||||
autocmd Filetype markdown nnoremap <localleader>p :MarkdownPreview<CR>
|
||||
" COMMON
|
||||
" disable auto comment prefix
|
||||
autocmd Filetype * setlocal formatoptions-=ro
|
||||
" keyword
|
||||
" keyword
|
||||
autocmd Filetype javascript,typescript,vue setlocal iskeyword+=$
|
||||
autocmd Filetype html,vue setlocal iskeyword+=-
|
||||
" tab
|
||||
" tab
|
||||
autocmd FileType make,java,python setlocal noexpandtab
|
||||
" syntax sync
|
||||
autocmd FileType markdown,vue syntax sync fromstart
|
||||
" run
|
||||
autocmd FileType javascript nnoremap <localleader>r :w<CR>:!node %<CR>
|
||||
augroup END
|
||||
|
||||
" basic
|
||||
|
@ -90,23 +54,19 @@ set backspace=indent,eol,start
|
|||
set nocompatible
|
||||
set nofoldenable
|
||||
set background=dark
|
||||
set nostartofline
|
||||
|
||||
" indent
|
||||
set list listchars=tab:\▸\-
|
||||
set list listchars=tab:▸-,trail:・
|
||||
set tabstop=2 shiftwidth=2 softtabstop=2 expandtab smarttab
|
||||
set autoindent smartindent
|
||||
let g:vim_indent_cont = 0
|
||||
if !exists('g:vim_indent_cont') | let g:vim_indent_cont = 0 | endif
|
||||
|
||||
" search
|
||||
set incsearch
|
||||
|
||||
" completion
|
||||
set completeopt=menu,menuone,noselect,noinsert
|
||||
|
||||
" status bar
|
||||
set laststatus=2
|
||||
set ruler
|
||||
set wildmenu
|
||||
|
||||
" command
|
||||
command Sup39Update !cd $HOME/.vim/sup39 && git pull
|
||||
set showcmd " pending command
|
||||
|
|
Loading…
Reference in a new issue