"如果映射失效,看一下是不是终端占用了快捷键
"修改快捷键配置后需要重启整个终端才能生效
"cst改变标签
"注意vrapperrc的leader键用空格时直接是<space>不用反斜杠
"ySS yss插入当前行, for css
"gd 查找所有选中
"'不要在i模式下使用space leader, 会有严重的延迟
"还有增加插件后记得PluginInstall
"非贪婪匹配和补全匹配到的字符 :%s/\(.\{-}\)while\s/\1for/g
" Start NERDTree
autocmd VimEnter * NERDTree
" autocmd VimEnter * Defx
" Go to previous (last accessed) window.
autocmd VimEnter * wincmd p
syntax on
set nobackup " no backup files
set noswapfile " no swap files
set nowritebackup " only in case you don't want a backup file while editing
set noundofile " no undo files
set ignorecase
set tabpagemax=1000
set smartcase
set ts=4
set sw=4
set expandtab autoindent
set nu
set nocompatible " be iMproved, required
set expandtab
set relativenumber
set numberwidth=1
set autoindent
set smartindent
set hlsearch
setlocal shiftwidth=4 "换行自动缩进4个空格
setlocal tabstop=4 "tab 键相当于4个空格
set encoding=utf-8
set clipboard=unnamedplus
"YCM speed slow?
":set fdm=marker
filetype indent on
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
"arm program syntax checker
Plugin 'https://github.com/ARM9/arm-syntax-vim.git'
Plugin 'scrooloose/nerdtree'
" Plugin 'Shougo/defx.nvim'
" Plugin 'roxma/nvim-yarp'
" Plugin 'roxma/vim-hug-neovim-rpc'
"For comment
Plugin 'https://github.com/tpope/vim-commentary.git'
"ctrl-p打开最近文件
Plugin 'ctrlp.vim'
" Plugin 'airblade/vim-gitgutter'
Plugin 'skywind3000/asyncrun.vim'
Plugin 'https://github.com/Valloric/YouCompleteMe.git'
Plugin 'https://github.com/jiangmiao/auto-pairs.git'
Plugin 'https://github.com/jaywcjlove/vim-web.git'
"for web programing
Plugin 'mattn/emmet-vim'
Plugin 'https://github.com/MattesGroeger/vim-bookmarks'
"markdown editor
Plugin 'https://github.com/suan/vim-instant-markdown.git'
"Plugin 'https://github.com/Shougo/neocomplete.vim.git'
"For JS
Plugin 'marijnh/tern_for_vim'
"可以解决html里js的缩进问题
" Plugin 'https://github.com/pangloss/vim-javascript.git'
Plugin 'https://github.com/hail2u/vim-css3-syntax.git'
"Plugin 'https://github.com/ayu-theme/ayu-vim.git'
"
"底线
Plugin 'itchyny/lightline.vim'
"主题
Plugin 'https://github.com/altercation/vim-colors-solarized.git'
Plugin 'dracula/vim'
"syntax checker
Plugin 'scrooloose/syntastic'
Plugin 'https://github.com/tpope/vim-surround.git'
Plugin 'https://github.com/majutsushi/tagbar.git'
""Plugin 'https://github.com/altercation/vim-colors-solarized.git'
call vundle#end() " required
filetype plugin indent on " required
if !has('gui_running')
set t_Co=256
endif
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'absolutepath', 'modified' ] ],
\ }
\ }
"标签显示显现
highlight BookmarkSign ctermbg=NONE ctermfg=160
highlight BookmarkLine ctermbg=194 ctermfg=NONE
let g:bookmark_sign = '⚑'
let g:bookmark_highlight_lines = 1
let g:tagbar_map_showproto = "K" "/* 解决leader key在tagbar中不起作用的问题*/
"markdown 不自动启动
let g:instant_markdown_autostart = 0
let g:instant_markdown_allow_unsafe_content = 1
nnoremap :md :InstantMarkdownPreview
let g:ycm_key_invoke_completion = '<c-space>'
let g:ycm_path_to_python_interpreter = '/usr/bin/python'
let g:ycm_add_preview_to_completeopt = 0
let g:ycm_auto_trigger = 1
let g:ycm_show_diagnostics_ui = 0
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_server_log_level = 'info'
let g:ycm_min_num_identifier_candidate_chars = 3
let g:ycm_collect_identifiers_from_comments_and_strings = 1
let g:ycm_complete_in_strings=1
set completeopt=menu,menuone
"for emmet, replace the <C-y> to <c-j>
let g:user_emmet_expandabbr_key = '<c-j>'
"auto jump to the position where inform the error
let g:syntastic_cpp_include_dirs = ["/usr/include/qt4/QtGui"]
let g:syntastic_cpp_include_dirs = ["/usr/include/qt/QtGui"]
let g:syntastic_cpp_include_dirs = ["/usr/include/qt/QtWidgets"]
let g:syntastic_c_auto_refresh_includes = 1
let g:syntastic_c_check_header = 1
let g:syntastic_auto_jump = 0
let g:syntastic_quiet_messages= { "type": "style" }
let g:syntastic_quiet_messages = { 'regex': ['deprecated\|note'] }
let g:syntastic_aggregate_errors=1
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_c_checkers = ['gcc']
let g:syntastic_c_config_file = '.config_c'
let g:syntastic_c_no_include_search = 1
let g:syntastic_java_checkers = ['javac']
let g:syntastic_html = ['tidy-html5']
let g:syntastic_python_checkers = ['python']
let g:syntastic_asm_checker = ['']
let g:syntastic_css = ['csslint']
let g:syntastic_javsacript_checkers = ['jslint']
let g:syntastic_c_config_file = '.include_file_for_syntastic'
let g:ctrlp_custom_ignore = '\.o'
"let g:ycm_show_diagnostics_ui = 0 "关闭ycm的语法检查, 否则sytastc会不能工作
let g:closetag_html_style=1 " 支持 html 风格"
let g:solarized_termcolors=256 "支持主题多色
let g:html_indent_script1 = "inc"
let g:html_indent_style1 = "inc"
let g:html_indent_inctags = "html,body,head,tbody"
let g:javascript_plugin_jsdoc = 1
let g:javascript_plugin_ngdoc = 1
let g:javascript_plugin_flow = 1
set completeopt-=preview
"Note: This option must be set in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)!
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
" For no inserting <CR> key.
"return pumvisible() ? "\<C-y>" : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
"inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
"inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
" Close popup by <Space>.
"inoremap <expr><Space> pumvisible() ? "\<C-y>" : "\<Space>"
" AutoComplPop like behavior.
"let g:neocomplete#enable_auto_select = 1
augroup javascript_folding
au!
au FileType javascript setlocal foldmethod=syntax
augroup END
"for arm-syntax-checker
au BufNewFile,BufRead *.s,*.S set filetype=arm " arm = armv6/7
nnoremap <F1> :call GtkInit()<CR>
func! GtkInit()
call append(0, "#include <gtk/gtk.h>")
call append(1, "")
call append(2, "gboolean key_press ( GtkWidget *window, GdkEventKey *event, gpointer *data );")
call append(3, "")
call append(4, "int main(int argc, char **argv)")
call append(5, "{")
call append(6, " GtkWidget *window;")
call append(7, " gtk_init(&argc, &argv);")
call append(8, "")
call append(9, " window = gtk_window_new(GTK_WINDOW_TOPLEVEL);")
call append(10, " gtk_window_set_default_size(GTK_WINDOW(window), 800, 600);")
call append(11, ' gtk_window_set_title(GTK_WINDOW(window), "");')
call append(12, "")
call append(13, ' g_signal_connect(G_OBJECT(window), "destroy", \')
call append(14, " G_CALLBACK(gtk_main_quit),NULL);")
call append(15, "")
call append(16, ' g_signal_connect(G_OBJECT(window), "key-press-event", \')
call append(17, " G_CALLBACK(key_press),NULL);")
call append(18, "")
call append(19, " gtk_widget_show_all(window);")
call append(20, " gtk_main();")
call append(21, "")
call append(22, " return 0;")
call append(23, "}")
call append(24, "")
call append(25, "gboolean key_press ( GtkWidget *window, GdkEventKey *event, gpointer *data ) {")
call append(26," if ( event->state == GDK_CONTROL_MASK ) {")
call append(27," if ( event->keyval == GDK_KEY_c) {")
call append(28," gtk_main_quit();")
call append(29," }")
call append(30," }")
call append(31," return TRUE;")
call append(32,"}")
exec "8"
endfunc
nnoremap <F3> :call CppInit()<CR>
func! CppInit()
call append(0,"#include <iostream>")
call append(1,"#include <vector>")
call append(2,"#include <string>")
call append(3,"#include <algorithm>")
call append(4,"#include <map>")
call append(5,"#include <queue>")
call append(6,"")
call append(7,"using namespace std;")
call append(8,"")
call append(9,"int main()")
call append(10,"{")
call append(11," ")
call append(12," return 0;")
call append(13,"}")
exec "12"
endfunc
"##### auto fcitx ###########
let g:input_toggle = 1
function! Fcitx2en()
let s:input_status = system("fcitx-remote")
if s:input_status == 2
let g:input_toggle = 1
let l:a = system("fcitx-remote -c")
endif
endfunction
function! Fcitx2zh()
let s:input_status = system("fcitx-remote")
if s:input_status != 2 && g:input_toggle == 1
let l:a = system("fcitx-remote -o")
let g:input_toggle = 0
endif
endfunction
"set ttimeoutlen=150
"退出插入模式
autocmd InsertLeave * call Fcitx2en()
"进入插入模式
autocmd InsertEnter * call Fcitx2en()
"##### auto fcitx end ######
"
"
nnoremap <F2> :call Compile()<CR>
func! Compile()
exec "w"
if &filetype == "c"
let headTxt=getline(1)
if headTxt == "#include <gtk/gtk.h>" || headTxt == "#include <gio/gio.h>" || headTxt == "#include <libnotify/notify.h>"
silent exec "!gcc `pkg-config --cflags --libs gtk+-3.0 gio-2.0 libnotify gstreamer-1.0 ` -lX11 -Wno-deprecated-declarations -lm % -o %<"
exec "!./%<"
elseif headTxt == "#include <gst/gst.h>"
silent exec "!gcc `pkg-config --cflags --libs gstreamer-1.0` -lm % -o %<"
exec "!./%<"
elseif headTxt == "#include <dbus/dbus.h>"
silent exec "!gcc `pkg-config --cflags --libs dbus-1 dbus-glib-1` -lm % -o %<"
exec "!./%<"
else
silent exec "!gcc % -o0 -o %< -lm -lreadline -lX11 -lXtst -lXext -lpthread -lXfixes -lhiredis -g -Wall"
exec "!./%<"
endif
elseif &filetype == "cpp"
silent exec "!g++ % -o %< -lm -g"
exec "!./%<"
elseif &filetype == "java"
silent exec "!javac %"
exec "!java %<"
elseif &filetype == "python"
exec "!python3 %"
elseif &filetype == "plot"
exec "!gnuplot % -p"
elseif &filetype == "dot"
exec "!dot -Tpng % -Gdpi=300 -o %<.png"
elseif &filetype == "sh"
silent exec "!chmod +x %"
exec "!sh %"
elseif &filetype == "JavaScript"
exec "!node %"
elseif &filetype == 'go'
exec '!go run %'
endif
endfunc
:map <F4> :call RunGdb()<CR>
func! RunGdb()
exec "w"
if &filetype == "c"
exec "!g++ % -g -o %<"
exec "!gdb ./%<"
elseif &filetype == "python"
exec "!chmod +x %"
exec "!python -m pdb %"
elseif &filetype == "cpp"
exec "!gdb %<"
endif
endfunc
map <F12> <ESC>:set nopaste<CR>
inoremap fk <ESC>
" nmap <tab> gg=G<CR>``
nnoremap :w!! :w !sudo tee %
imap mian main
nmap <F10> :nohl<CR>
nnoremap :full :call Full()<Cr>
func! Full()
call append(0,"#include <stdio.h>")
call append(1, "")
call append(2, "int main(int argc, char **argv)")
call append(3, "{")
call append(4, " return 0;")
call append(5, "}")
exec "5"
endfunc
nnoremap :pt :call FullPython()<cr>
func! FullPython()
call append(0, "#!/usr/bin/python3")
call append(1, "#-*-coding:utf8-*-")
call append(2, "")
exec "2"
endfunc
inoremap printf printf("\n");<Left><Left><Left><Left><Left>
inoremap fprintf fprintf();<Left><Left>
imap scanf scanf("");<Left><Left><Left>
imap fscanf fscanf();<Left><Left>
imap sop System.out.println();<Left><Left>
let mapleader="\<Space>"
nnoremap tg gT
nnoremap <Leader>w :wa<CR>
nnoremap <Leader>q :wa<CR>:qa<CR>
nnoremap <Leader><Leader> V
nnoremap <Leader>; $
nnoremap <Leader>p :set paste<CR>
nnoremap <Leader>v <C-v>
nnoremap <Leader>z :q<CR>
nnoremap <Leader>r <C-r>
"切换vim分屏
nnoremap <Leader>h <C-w>h
nnoremap <Leader>j <C-w>l
nnoremap <Leader>k <C-w>h
nnoremap <Leader>l <C-w>l
nnoremap <Leader>s :vsplit<CR>
nnoremap <Leader>a ^
nnoremap <Leader>- :split<CR>
nnoremap <Leader>' %
nnoremap <Leader>= A<Space>=<Space>
inoremap <C-g> <ESC>bgUee
nnoremap <C-g> bgUee;
nnoremap <leader>; A;<ESC>
nnoremap <leader>f $
nnoremap <Leader>, f)
" nnoremap <Tab> m1gg=G`1
nmap <leader>/ gcc
nnoremap <silent> <F5> :call InitFunctonTable()<CR>
function! InitFunctonTable()
exec "!ctags -R --exclude=.git ."
endfunction
imap psvm public static void main(String[] args) {}<Left>
imap /* /* */<Left><Left>
imap <! <!----><Left><Left><Left>
imap sfo sizeof()<Left>
imap perror perror("");<Left><Left><Left>
inoremap none none
inoremap imain int main(int argc, char **argv){}<Left><Left><CR><Right><CR><Up><Right><Cr>
inoremap bs4 from bs4 import BeautifulSoup
inoremap uopen from urllib.request import urlopen
autocmd filetype *html* imap <c-_> <c-y>/
autocmd filetype *html* map <c-_> <c-y>/
inoremap imap inoremap
"GTK"
"For gtk
"inoremap gwn gtk_window_new ()<Left>
"inoremap gwst gtk_window_set_title (GTK_WINDOW())<Left><Left>
"inoremap gwss gtk_window_set_default_size (GTK_WINDOW())<Left><Left>
"inoremap gwsp gtk_window_set_position (GTK_WINDOW())<Left><Left>
"inoremap gwsi gtk_window_set_icon (GTK_WINDOW())<Left><Left>
"inoremap gws gtk_widget_show ()<Left>
"inoremap gsc g_signal_connect ()<Left>
"inoremap gmain gtk_main ();<ESC>
"inoremap GW GTK_WINDOW()<Left>
"inoremap gwpc GTK_WIN_POS_CENTER
"inoremap gob G_OBJECT()<Left>
"inoremap gsbw gtk_container_set_border_width (GTK_CONTAINER())<Left><Left>
"inoremap gstt gtk_widget_set_tooltip_text ()<Left>
"inoremap gca gtk_container_add ()<Left>
"inoremap bnwl gtk_button_new_with_label ()<Left>
"inoremap bnwm gtk_button_new_with_mnemonic ()<Left>
"inoremap GC GTK_CONTAINER()<Left>
"inoremap gwsa gtk_widget_show_all ()<Left>
"inoremap gcb G_CALLBACK()<Left>
"inoremap gapp GtkApplication
"inoremap gan gtk_application_new ()<Left>
"inoremap gawn gtk_application_window_new ()<Left>
"inoremap gar g_application_run (G_APPLICATION())<Left><Left>
"inoremap GA GtkApplication
"" inoremap AP G_APPLICATION()<Left>
"inoremap gou g_object_unref ()<Left>
"inoremap gprint g_print ("\n");<Left><Left><Left><Left><Left>
"inoremap ggn gtk_grid_new ()<Left>
"inoremap gga gtk_grid_attach (GTK_GRID());<Left><Left><Left>
"inoremap gss g_signal_connect_swapped ()<Left>
"inoremap gwc gtk_window_close ();<Left><Left>
"inoremap gbps gtk_box_pack_start ();<Left><Left>
"inoremap tbct gtk_text_buffer_create_tag ();<Left><Left>
"inoremap giao gtk_text_buffer_get_iter_at_offset ();<Left><Left>
"inoremap gtwi gtk_text_buffer_insert ();<Left><Left>
"inoremap iwtbn gtk_text_buffer_insert_with_tags_by_name ();<Left><Left>
"inoremap gtv GTK_TEXT_VIEW()<Left>
"inoremap scv gtk_text_view_set_cursor_visible ();<Left><Left>
"inoremap tbst gtk_text_buffer_set_text ();<Left><Left>
"inoremap tvgb gtk_text_view_get_buffer ();<Left><Left>
"inoremap twsb gtk_text_view_set_buffer ();<Left><Left>
"inoremap gmq gtk_main_quit();<Esc>
"inoremap gwi GtkWidget
"inoremap gwd gtk_widget_destroy();<Left><Left>
"inoremap GG GTK_GRID()<Left>
"inoremap gbui GtkBuilder
"inoremap gov GTK_ORIENTATION_VERTICAL
"inoremap GOV GTK_ORIENTATION_VERTICAL
"inoremap goh GTK_ORIENTATION_HORIZONTAL
"inoremap GOH GTK_ORIENTATION_HORIZONTAL
"inoremap goj GObject
"inoremap gero GError
"inoremap gnb gtk_builder_new()<Left>
"inoremap gbaf gtk_builder_add_from_file()<Left>
"inoremap gafn G_APPLICATION_FLAGS_NONE
"inoremap gper g_printerr()<Left>
"inoremap gcr g_clear_error()<Left>
"inoremap gbgo gtk_builder_get_object ()<Left>
"inoremap ginit gtk_init(&argc, &argv);<CR>
"inoremap gbxn gtk_box_new();<Left><Left>
"inoremap gtn gtk_table_new();<Left><Left>
"inoremap tad gtk_table_attach_defaults(GTK_TABLE())<Left><Left>
"inoremap gfn gtk_fixed_new();<CR>
"inoremap gkt gtk
"inoremap gfp gtk_fixed_put(GTK_FIXED());<left><left><left>
"inoremap gfm gtk_fixed_move(GTK_FIXED());<left><left><left>
"inoremap wss gtk_widget_set_size_request ( );<left><left><left>
"inoremap gen gtk_entry_new();
"inoremap gest gtk_entry_set_text(GTK_ENTRY());<Left><Left><Left>
"inoremap gse gtk_editable_set_editable(GTK_EDITABLE());<Left><Left><Left>
"inoremap gbt GtkButton
"inoremap bgl gtk_button_get_label();<left><Left>
"inoremap gbsl gtk_button_set_label();<left><left>
"inoremap gbn gtk_builder_new();<left><left>
"inoremap boxn gtk_box_new();<left><left>
"inoremap inff gtk_image_new_from_file("");<left><left><left>
"inoremap gbox gtk_box_new();<left><left>
"inoremap GP GdkPixbuf
"inoremap pnff gdk_pixbuf_new_from_file();<left><left>
"inoremap pss gdk_pixbuf_scale_simple();<left><left>
"inoremap infp gtk_image_new_from_pixbuf();<left><left>
"inoremap igp gtk_image_get_pixbuf();<left><left>
"inoremap isfp gtk_image_set_from_pixbuf();<left><left>
"inoremap pbn gtk_progress_bar_new();<ESC>
"inoremap pbsf gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR());<left><left><left>
"inoremap pbgf gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR());<left><left><left>
"inoremap pbst gtk_progress_bar_set_text(GTK_PROGRESS_BAR());<left><left><left>
"inoremap pbso gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR());<left><left><left>
"inoremap gpb GTK_PROGRESS_BAR()<left>
"inoremap prtl GTK_PROGRESS_RIGHT_TO_LEFT
"inoremap pltr GTK_PROGRESS_LEFT_TO_RIGHT
"inoremap pbsst gtk_progress_set_show_text(GTK_PROGRESS_BAR());<left><left><left>
"inoremap pbgst gtk_progress_get_show_text(GTK_PROGRESS_BAR());<left><left><left>
"inoremap bsi gtk_button_set_image();<left><left>
"inoremap bsr gtk_button_set_relief(GTK_BUTTON());<left><left><left>
"inoremap egt gtk_entry_get_text(GTK_ENTRY());<left><left><left>
"inoremap esml gtk_entry_set_max_length(GTK_ENTRY());<left><left><left>
"inoremap GNB GtkNotebook
"inoremap gnn gtk_notebook_new();<Esc>
"inoremap nstp gtk_notebook_set_tab_pos(GTK_NOTEBOOK());<left><left><left>
"inoremap nap gtk_notebook_append_page(GTK_NOTEBOOK());<left><left><left>
"inoremap gnip gtk_notebook_insert_page(GTK_NOTEBOOK());<left><left><left>
"inoremap wsap gtk_widget_set_app_paintable();<left><left>
"inoremap gwr gtk_widget_realize();<left><left>
"inoremap gln gtk_layout_new();<left><left>
"inoremap glp gtk_layout_put ();<left><left>
"inoremap glbn gtk_label_new();<left><left>
"inoremap gwqd gtk_widget_queue_draw();<left>
"inoremap prmm gdk_pixbuf_render_pixmap_and_mask();<left><left>
"inoremap gwsbpm gdk_window_set_back_pixmap();<left><left>
"inoremap PF PangoFontDescription
"inoremap pfss pango_font_description_set_size();<left><left>
"inoremap gwmf gtk_widget_modify_font(GTK_WIDGET());<left><left><left>
"inoremap pff pango_font_description_free();<left>
"inoremap swfs set_widget_font_size();<left>
"inoremap GEB GdkEventButton
"inoremap glgt gtk_label_get_text ();<left><left>
"inoremap glst gtk_label_set_text ();<left><left>
"inoremap gebn gtk_event_box_new ();<Esc>
"inoremap gwse gtk_widget_set_events();<left><left>
"inoremap gbpm GDK_BUTTON_PRESS_MASK
"inoremap gwshe gtk_widget_set_hexpand ();<left><left>
"inoremap gwsve gtk_widget_set_vexpand ();<left><left>
"inoremap gwsha gtk_widget_set_halign ();<left><left>
"inoremap gwsva gtk_widget_set_valign ();<left><left>
"
"inoremap GB GTK_BOX()<left>
"inoremap GLB GTK_LIST_BOX()<left>
"inoremap GSW GTK_SWITCH()<left>
"inoremap GSC GTK_SCALE()<LEFT>
"inoremap GRG GTK_RANGE()<left>
inoremap windwo window
inoremap windown window
inoremap pirnt print
"inoremap false FALSE
inoremap <c-*> <Esc>^i/*$*i*/<Esc>
nnoremap <c-*> <Esc>^i/*$*i*/<Esc>
inoremap ^* /**/
" inoremap <C-l> <Esc>A:<Esc>
" nnoremap <C-l> A:<Esc>
inoremap print9 print()<Left>
inoremap itn int
map <F9> :SyntasticToggleMode<CR>
let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': [] }
let f8value = '1'
map <F8> :call ToggleF8()<CR>
func! ToggleF8()
if g:f8value == '2'
set nu relativenumber
let g:f8value = '1'
elseif g:f8value == '1'
set nonu norelativenumber
let g:f8value = '2'
endif
endfunction
nnoremap <Leader>k <C-w>k
nnoremap <Leader>j <C-w>j
nnoremap <C-/> ^i//<ESC>
"inoremap pred printf("\033[0;31m \033[0m\n");<left><left><left><left><left><left><left><left><left><left><left><left><left>
"inoremap pgreen printf("\033[0;32m \033[0m\n");<left><left><left><left><left><left><left><left><left><left><left><left><left>
"inoremap pyellow printf("\033[0;33m \033[0m\n");<left><left><left><left><left><left><left><left><left><left><left><left><left>
"inoremap pblue printf("\033[0;34m \033[0m\n");<left><left><left><left><left><left><left><left><left><left><left><left><left>
"inoremap pmag printf("\033[0;35m \033[0m\n");<left><left><left><left><left><left><left><left><left><left><left><left><left>
"inoremap pcyan printf("\033[0;36m \033[0m\n");<left><left><left><left><left><left><left><left><left><left><left><left><left>
"for theme
" Change the cursor from block to i-beam in INSERT mode
let &t_SI = "\e[5 q"
let &t_EI = "\e[1 q"
let g:solarized_termcolors=256
set background=dark
syntax enable
colorscheme solarized
"colorscheme dracula
"must come after colorscheme
"对应颜色http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
highlight Pmenu ctermfg=247 ctermbg=24 guifg=#ffffff guibg=#000000
let currentDir=getcwd()
if currentDir =~ "/home/rease/Documents/GTK/"
let g:syntastic_c_checkers = ['']
let headTxt=getline(1)
if headTxt == "#include <QApplication>"
let g:syntastic_c_checkers = ['']
endif
endif
nnoremap <leader>t :TagbarToggle<CR>
inoremap reqeust request
set foldlevel=99
nnoremap :Q! :q!
nnoremap :Q :q
nnoremap gj g;
nnoremap <leader>z :qa!<cr>
nnoremap <leader>g :NERDTreeToggle<CR>
nnoremap <leader>b :terminal<cr>
inoremap #- #-*- coding: utf8 -*-<ESC>
nnoremap :mv :mkview<CR>
nnoremap :lv :loadview<CR>
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview
nnoremap * :keepjumps normal! mi*`i<CR>
nnoremap z[ zfa{
autocmd FileType python setlocal equalprg=/usr/lib/python3.9/Tools/scripts/reindent.py
nnoremap <C-r> :!./%<<CR>
" set cmdheight=0
let g:bargreybars_auto = 0
:nnoremap <C-]> g<C-]>
set laststatus=2
set statusline=%F
highlight Comment ctermfg=DarkGray guifg=DarkGray
" 翻译当前单词
nnoremap <leader>c :!tran <c-r><c-w><cr>