diff --git a/plug.vim b/plug.vim index eeb2ef7..07a454c 100644 --- a/plug.vim +++ b/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() diff --git a/vimrc b/vimrc index dba4282..108cbfc 100644 --- a/vimrc +++ b/vimrc @@ -1,3 +1,5 @@ +let sfile = expand('') + " map-leader if !exists('mapleader') let mapleader='q' @@ -9,77 +11,39 @@ if !exists('maplocalleader') noremap endif inoremap jk -inoremap Jk inoremap JK " file " save nnoremap :w inoremap :w " copy - nnoremap C :w !pbcopy + nnoremap C :%y* " tab edit nnoremap e :tabe - nnoremap vv :tabe $HOME/.vim/sup39/vimrc - nnoremap vp :tabe $HOME/.vim/sup39/plug.vim - nnoremap vd :tabe $HOME/.vim/sup39/ + execute 'nnoremap vv :tabe '.sfile.'' nnoremap V :tabe $MYVIMRC " search nnoremap / /\v nnoremap ? ?\v -nnoremap sl :s/\v -nnoremap se :.,$s/\v -nnoremap ss :%s/\v nnoremap hh :set hlsearch! incsearch! nnoremap hc :nohlsearch -" ale -nnoremap r :ALERename -nnoremap n :ALENext -nnoremap p :ALEPrevious -nnoremap :ALEHover -nnoremap db :ALEGoToDefinition -tab -nnoremap dm :ALEGoToDefinition -nnoremap dl :ALEDetail " external nnoremap m :w:!make " syntax nnoremap S :syntax sync fromstart " debug -nnoremap x :exe getline('.') -nnoremap X :exe join(getline('.', '$'), "\n") nnoremap H :echo synIDattr(synID(line("."),col("."),1),"name") " filetype-dependent augroup sup39_auto autocmd! " vim - " source autocmd Filetype vim noremap s :w:so % - " c, cpp - " macro - autocmd Filetype c,cpp noremap h - \:call setline('.', toupper(substitute(@%, '\.', '_', 'g'))) - \yyI#ifndef p#define o#endifkki - autocmd Filetype c,cpp noremap i - \:call setline('.', - \'#include "'.substitute(@%, '\.\zsc\ze\(pp\)\?$', 'h', '').'"')o - " abbr - autocmd Filetype c,cpp iabbrev #i #include - autocmd Filetype c,cpp iabbrev #I #include - " markdown - " plugin - autocmd Filetype markdown nnoremap p :MarkdownPreview - " 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 r :w:!node % 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