Vimrc备份
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 |
"如果映射失效,看一下是不是终端占用了快捷键 "修改快捷键配置后需要重启整个终端才能生效 "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> |
Continue reading...
Git ignore files with one command
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#!/usr/bin/bash GitIgnoreDir=`git rev-parse --show-toplevel` GitIgnoreFile=$GitIgnoreDir"/.gitignore" CurrentDir=`pwd` for var in $@ do targetFileFullPath=$CurrentDir"/"$var targetFileRelativePath=`echo -e $targetFileFullPath | awk -F$GitIgnoreDir '{print $2}'` targetFileRelativePath=${targetFileRelativePath:1:10000} echo $targetFileRelativePath echo -e $targetFileRelativePath >> $GitIgnoreFile done |
Continue reading...
C语言检测变量类型
1 2 3 4 |
if(__builtin_types_compatible_p(typeof(KEY), int)) // do something |
1 2 3 |
typedef typeof(TYPE_K*) TYPE_K_POINTER; // typeof 定义变量 |
Continue reading...
根据指针获取所申请内存的实际大小 (C/C++)
副标题:根据指针获取malloc空间大小 前言: 有时候程序出现coredump时,需要知道是所申请的内存空间被程序自身越界访问导致,还是双次释放导致。但不太好排查,这里提供一种思路。 一....
Continue reading...glade: symbol lookup error: glade: undefined symbol: gdk_broadway_display_get_type
未定义的符号原本应该是在 libgtk-3.so.0 里的, 因为Linux共享库的机制,...
Continue reading...VirtualBox 无法访问共享文件夹
1 2 3 4 |
sudo usermod -a -G vboxsf $USER sudo chown $USER: /media -R |
注意修改/media为自己共享目录的路径,最好取最上层目录。 比如如果实际共享目录地址为/media/sf_green,但是只为登录用户加了sf_green的所有者权限,在访问不了media的情况下,sf_green依旧会无法访问
Continue reading...