"""""""""""""""""""""""""""""""""""""""""""""""""""""""" " General Setting """""""""""""""""""""""""""""""""""""""""""""""""""""""" set spelllang=en_us set spelllang+=cjk set spell syntax on filetype on filetype plugin on autocmd BufNewFile,BufRead *.json setl ft=jsonc autocmd FileType python let b:coc_root_patterns = ['.git', '.env', 'venv', '.venv', 'setup.cfg', 'setup.py', 'pyproject.toml', 'pyrightconfig.json'] """""" netrw """""" let g:netrw_fastbrowse = 0 let g:netrw_banner=0 let g:netrw_keepdir = 0 let g:netrw_liststyle = 3 let g:netrw_altv = 1 let g:netrw_browse_split = 4 autocmd FileType netrw setl bufhidden=wipe """""" command completion """""" set wildmenu set wildmode=longest:full,full set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx,*DS_STORE,*.db """""" folding """""" set foldmethod=indent " fold based on indent set foldnestmax=10 " deepest fold is 20 levels set nofoldenable " don't fold by default set foldlevel=2 """""" tab and indentation """""" set tabstop=4 " Tab is 4 spaces set shiftwidth=4 " The # of spaces for indenting. set softtabstop=4 " Tab key results in # spaces set ai " Tab key results in # spaces"Auto indent set si "Smart indent set smarttab set expandtab "convert tabs to spaces set nu! "toggle the line numbers set backspace=indent,eol,start set autoindent smartindent set mouse=a set clipboard=unnamed set nocompatible set showcmd set autoread " reload files if changed externally set ignorecase smartcase set hlsearch " highlight searches set pumheight=10 set noshowmode " we don't need to see things like -- INSERT -- anymore set undofile " enable persistent undo set nobackup nowritebackup set sidescrolloff=5 " Start scrolling n chars before end of screen. """""" UI """""" set termguicolors autocmd colorscheme * highlight DiffAdd gui=none guifg=#A1C281 guibg=None autocmd colorscheme * highlight DiffChange gui=none guifg=#74ADEA guibg=None autocmd colorscheme * highlight DiffDelete gui=none guifg=#FE747A guibg=None set guicursor=i:ver100-blinkon100 \,r:hor100 """""" remap """""" let mapleader = ',' nmap ggVG imap ggVG nmap lua require('telescope.builtin').find_files() imap lua require('telescope.builtin').find_files() nmap lua require('telescope.builtin').commands() imap lua require('telescope.builtin').commands() nmap lua require('telescope.builtin').builtin() imap lua require('telescope.builtin').builtin() nmap lua require('telescope.builtin').live_grep() imap lua require('telescope.builtin').live_grep() nmap lua require('telescope.builtin').current_buffer_fuzzy_find() imap lua require('telescope.builtin').current_buffer_fuzzy_find() nmap :NvimTreeToggle imap :NvimTreeToggle nmap :NvimTreeRefresh nmap :w imap :w nmap :q nmap :qa! nmap :lua require("Comment.api").toggle_current_linewise() vmap :lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode()) imap :lua require("Comment.api").toggle_current_linewise() nmap :bd imap :bd imap imap z u nmap : map "_dd "nmap :if &modifiable && !&readonly && &modified :write :endif:bnext function! TabEnable() let num = winnr('$') if num == 1 return ":bnext\" else return "\w" endif endfunction nmap TabEnable() nmap ] :BufferLineCycleNext imap ] :BufferLineCycleNext nnoremap [ :BufferLineCyclePrev inoremap [ :BufferLineCyclePrev nmap ':set wrap! go'.'-+'[&wrap]."=b\r" command! -nargs=0 UpdateAll :exe "TSUpdate" | exe "PlugUpdate" | exe "PlugUpgrade" " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable " delays and poor user experience. set updatetime=50 let g:cursorhold_updatetime = 100 " Don't pass messages to |ins-completion-menu|. " set shortmess+=c if has('nvim') set signcolumn=yes:1 else set signcolumn=yes endif """""""""""""""""""""""""""""""""""""""""""""""""""""""" " General Setting for vimspector """""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:vimspector_enable_mappings = 'VISUAL_STUDIO' let g:vimspector_install_gadgets = [ \ 'CodeLLDB', \ 'debugpy', \ ]