<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    New

      BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
      21 Posts :: 0 Stories :: 4 Comments :: 0 Trackbacks

    我的評論

    re: java筆記 H.C 2011-11-24 18:07  
    JRadioButton 二選一

    加入Buttongroup


    觸發(fā)組件的監(jiān)聽
    public void actionPerformed(ActionEvent e){
    if(jrbBox.isSelected()){
    System.out.println("你選擇了:"+jrbBox.getText());
    }
    if(jrbGirl .isSelected()){
    System.out.println("你選擇了:"+jrbGirl .getText());
    }
    re: ubuntu 中文亂碼 H.C 2011-11-12 10:16  
    Ubuntu里面的環(huán)境配置文件:

    (1)/etc/enviroment 是系統(tǒng)的環(huán)境變量。

    (2)/etc/profile: 是所有用戶的環(huán)境變量。當用戶第一次登錄時,該文件被執(zhí)行. 并從/etc/profile.d目錄的配置文件中搜集shell的設(shè)置。

    (3)/etc/bashrc: 為每一個運行bash shell的用戶執(zhí)行此文件.當bash shell被打開時,該文件被讀取。

    (4)~/.bash_profile: 每個用戶都可使用該文件輸入專用于自己使用的shell信息,當用戶登錄時,該文件僅僅執(zhí)行一次!默認情況下,他設(shè)置一些環(huán)境變量,執(zhí)行用戶的.bashrc文件。

    (5)~/.bashrc: 該文件包含專用于你的bash shell的bash信息,當?shù)卿洉r以及每次打開新的shell時,該該文件被讀取。

    (6) ~/.bash_logout:當每次退出系統(tǒng)(退出bash shell)時,執(zhí)行該文件. 另外,/etc/profile中設(shè)定的變量(全局)的可以作用于任何用戶,而~/.bashrc等中設(shè)定的變量(局部)只能繼承 /etc/profile中的變量,他們是”父子”關(guān)系。

    (7)~/.bash_profile 是交互式、login 方式進入 bash 運行的~/.bashrc 是交互式 non-login 方式進入 bash 運行的通常二者設(shè)置大致相同,所以通常前者會調(diào)用后者。
    re: VIM for java IDE H.C 2011-11-11 16:25  
    需要用到的插件:

    taglist需要ctags支持

    ctags.exe:http://ctags.sourceforge.net/

    taglist顯示tag列表

    taglist:http://www.vim.org/scripts/script.php?script_id=273

    顯示buf列表:

    bufexplorer:http://www.vim.org/scripts/script.php?script_id=42

    Nerd_Tree文件瀏覽

    Nerd_tree:http://www.vim.org/scripts/script.php?script_id=1658

    界面管理插件:

    winmanager:http://www.vim.org/scripts/script.php?script_id=95



    一、ctags:

    下載解壓后是源碼,感覺就那個exe文件有點用。直接放到一個目錄里,D:\ctags58。

    設(shè)置一下環(huán)境變量。path=D:\ctags58。這樣可以直接運行目錄下面的ctags.exe文件。或者直接把ctags.exe放入windows的目錄里。

    vimrc中的設(shè)置:
    view sourceprint?
    1 "生成一個tags文件
    2 nmap <F9> <Esc>:!ctags -R *<CR>



    二、taglist設(shè)置:

    下載解壓到相應的vim文件夾中。

    vimrc中設(shè)置:
    view sourceprint?
    01 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    02
    03 "設(shè)置Taglist
    04
    05 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    06
    07 " 這項必須設(shè)定,否則出錯,配置taglist的ctags路徑
    08
    09 let Tlist_Ctags_Cmd = 'D:\ctags58\ctags.exe'
    10
    11
    12
    13 " 不同時顯示多個文件的 tag ,只顯示當前文件的
    14
    15 let Tlist_Show_One_File=1
    16
    17
    18
    19 " 如果 taglist 窗口是最后一個窗口,則退出 vim
    20
    21 let Tlist_Exit_OnlyWindow=1
    22
    23
    24
    25 "讓當前不被編輯的文件的方法列表自動折疊起來
    26
    27 let Tlist_File_Fold_Auto_Close=1
    28
    29
    30
    31 "把taglist窗口放在屏幕的右側(cè),缺省在左側(cè)
    32
    33 let Tlist_Use_Right_Window=1
    34
    35
    36
    37 "顯示taglist菜單
    38
    39 let Tlist_Show_Menu=1
    40
    41
    42
    43 "啟動vim自動打開taglist
    44
    45 "let Tlist_Auto_Open=1

    啟動自動打開這個選項暫時不設(shè)置。后面要讓winmanager調(diào)用taglist。



    三、bufexplorer:

    下載解壓,沒啥說的。



    四、winmanager:

    下載解壓,vimrc中的設(shè)置:
    view sourceprint?
    01 """""""""""""""""""""""""""""""
    02
    03 "" winManager setting
    04
    05 """""""""""""""""""""""""""""""
    06
    07 "設(shè)置界面分割
    08
    09 "let g:winManagerWindowLayout = "BufExplorer,FileExplorer|TagList"
    10
    11 let g:winManagerWindowLayout = "TagList|FileExplorer,BufExplorer"
    12
    13
    14
    15 "設(shè)置winmanager的寬度,默認為25
    16
    17 let g:winManagerWidth = 30
    18
    19
    20
    21 "定義打開關(guān)閉winmanager按鍵
    22
    23 nmap <silent> <F8> :WMToggle<cr>



    以上3個插件安裝設(shè)置完畢后,基本的界面功能就可以實現(xiàn)了。按F8可以打開/關(guān)閉界面。同時顯示taglist和fileexplorer。在fileexplorer窗口中按<c-n>可以切換到bufexplorer窗口。

    上述設(shè)置好后,有3個問題:

    1 我想讓插件顯示在右側(cè),但是winmanager里面沒有此選項

    2 進入vim時候不能自動打開winmanager,winmanager不像taglist支持該功能

    3 退出時不會像只有taglist時候那樣,退出當前文件就會退出vim了

    經(jīng)過多次修改代碼終于實在了上述3個功能。



    五、將插件顯示在右側(cè)

    打開winmanager.vim,在function! <SID>StartWindowsManager()函數(shù)中修改:

    將:wincmd H 修改為wincmd L:
    view sourceprint?
    1 " for now assume that the explorer windows always stay on the left.
    2
    3 " TODO: make this optional later
    4
    5 " make the explorers window always stay on the right ---by chenyong
    6
    7 " wincmd H
    8
    9 wincmd L



    六、進入vim自動打開winmanager

    這個功能作為可選功能,我們可以在vimrc中設(shè)置:
    view sourceprint?
    1 "在進入vim時自動打開winmanager
    2
    3 let g:AutoOpenWinManager = 1

    就可以讓winmanager自動打開。

    在winmanager.vim中修改:

    view sourceprint?
    1 "set auto open Winmanager
    2
    3 if g:AutoOpenWinManager
    4
    5 autocmd VimEnter * nested call s:StartWindowsManager()|1wincmd w
    6
    7 endif



    七、退出緩沖區(qū)時,自動退出vim

    這個功能是參考了taglist的自動退出功能,在taglist.vim中修改的。

    函數(shù):function! s:Tlist_Window_Exit_Only_Window()中的winbunr(2)改為winbunr(3),即只剩2個窗口時關(guān)閉,考慮到2個窗口肯定是同時存在,所以這樣還是可行的:
    view sourceprint?
    01 function! s:Tlist_Window_Exit_Only_Window()
    02
    03 " Before quitting Vim, delete the taglist buffer so that
    04
    05 " the '0 mark is correctly set to the previous buffer.
    06
    07 if v:version < 700
    08
    09 if winbufnr(3) == -1
    10
    11 bdelete
    12
    13 quit
    14
    15 endif
    16
    17 else
    18
    19 if winbufnr(3) == -1
    20
    21 if tabpagenr('$') == 1
    22
    23 " Only one tag page is present
    24
    25 bdelete
    26
    27 quit
    28
    29 else
    30
    31 " More than one tab page is present. Close only the current
    32
    33 " tab page
    34
    35 close
    36
    37 endif
    38
    39 endif
    40
    41 endif
    42
    43 endfunction

    同時在vimrc中需要設(shè)置:
    view sourceprint?
    1 let Tlist_Exit_OnlyWindow=1


    winmanager自帶的fileexplorer這個插件實在是比較差。最重要的一點是fileexplorer不能自動更新,如果通過其他的途徑修改了文件夾中的內(nèi)容,fileexplorer是不會顯示的。相對而言Nerd_Tree 功能就比較強大了。下面要把Nerd_Tree加入winmanager。

    四、Nerd_tree:

    下載解壓,打開NERD_tree.vim,按照winmanager的說明,在最后加入下面代碼:
    view sourceprint?
    01 "Used by winmanager {{{1
    02
    03 let g:NERDTree_title = "[NERDTree]"
    04
    05 function! NERDTree_Start()
    06
    07 exe 'NERDTree'
    08
    09 endfunction
    10
    11
    12
    13 function! NERDTree_IsValid()
    14
    15 return 1
    16
    17 endfunction

    同時把在vimrc中:
    view sourceprint?
    1 let g:winManagerWindowLayout='NERDTree|TagList,BufExplorer'

    原來的設(shè)置注釋掉。加好后,發(fā)現(xiàn)每次打開winmanager都會出現(xiàn)一個空白的buffer。試驗了好多次,但是Nerd_tree調(diào)用的函數(shù)就是會打開一個新窗口。因為如此,將bufExplorer和NERD_Tree放在一起會顯示不正常。NERD_Tree放在下面的窗口也會出錯,實在比較郁悶。。。??戳讼翹ERD_Tree的代碼,沒看懂,只好再次改winmanager的代碼了。

    打開winmanager.vim,找到函數(shù)function! <SID>ToggleWindowsManager(),加入兩行,修改后整個函數(shù)如下:




    view sourceprint?
    01 " toggle showing the explorer plugins.
    02 function! <SID>ToggleWindowsManager()
    03 if IsWinManagerVisible()
    04 call s:CloseWindowsManager()
    05 else
    06 call s:StartWindowsManager()
    07 " NERD_tree need this. 打開時會有一個空白窗口,要把他關(guān)閉。
    08 exe '1wincmd w'
    09 exe 'q'
    10 end
    11 endfunction



    加個注釋,以免以后忘掉了,如果不想用nerd_Tree了,這2句話還得刪掉。



    另外打開時的命令和關(guān)閉時的命令也得同時修改了,試驗了很多次:

    taglist.vim中,找到下面的代碼:


    view sourceprint?
    1 " Exit Vim itself if only the taglist window is present (optional)
    2 " if g:Tlist_Exit_OnlyWindow
    3 " autocmd BufEnter __Tag_List__ nested
    4 " \ call s:Tlist_Window_Exit_Only_Window()
    5 " endif



    將這段代碼修改為:


    view sourceprint?
    01 " Exit Vim itself if only the taglist window is present (optional)
    02 let s:NERDTreeBufName = 'NERD_tree_'
    03 if g:Tlist_Exit_OnlyWindow
    04 augroup Exit_onlywindow
    05 "當進入Nerd_Tree的buffer時也檢測是否需要退出
    06 exec "autocmd BufEnter ". s:NERDTreeBufName .
    07 \"* call s:Tlist_Window_Exit_Only_Window()"
    08 autocmd BufEnter __Tag_List__ nested
    09 \ call s:Tlist_Window_Exit_Only_Window()
    10 augroup end
    11 endif



    winmanager中:剛才添加的自動執(zhí)行命令要改為:


    view sourceprint?
    1 "set auto open Winmanager
    2 if g:AutoOpenWinManager
    3 " autocmd VimEnter * nested call s:StartWindowsManager()|1wincmd w
    4 autocmd VimEnter * nested call s:StartWindowsManager()|1wincmd w|q
    5 endif

    這樣所有的功能就實現(xiàn)了。在taglist窗口使用ctrl+n可以轉(zhuǎn)換到bufexplorer窗口。
    re: VIM for java IDE H.C 2011-11-09 21:52  
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Maintainer: amix the lucky stiff
    " http://amix.dk - amix@amix.dk
    "
    " Version: 3.6 - 25/08/10 14:40:30
    "
    " Blog_post:
    " http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc
    " Syntax_highlighted:
    " http://amix.dk/vim/vimrc.html
    " Raw_version:
    " http://amix.dk/vim/vimrc.txt
    "
    " How_to_Install_on_Unix:
    " $ mkdir ~/.vim_runtime
    " $ svn co svn://orangoo.com/vim ~/.vim_runtime
    " $ cat ~/.vim_runtime/install.sh
    " $ sh ~/.vim_runtime/install.sh <system>
    " <sytem> can be `mac`, `linux` or `windows`
    "
    " How_to_Upgrade:
    " $ svn update ~/.vim_runtime
    "
    " Sections:
    " -> General
    " -> VIM user interface
    " -> Colors and Fonts
    " -> Files and backups
    " -> Text, tab and indent related
    " -> Visual mode related
    " -> Command mode related
    " -> Moving around, tabs and buffers
    " -> Statusline
    " -> Parenthesis/bracket expanding
    " -> General Abbrevs
    " -> Editing mappings
    "
    " -> Cope
    " -> Minibuffer plugin
    " -> Omni complete functions
    " -> Python section
    " -> JavaScript section
    "
    "
    " Plugins_Included:
    " > minibufexpl.vim - http://www.vim.org/scripts/script.php?script_id=159
    " Makes it easy to get an overview of buffers:
    " info -> :e ~/.vim_runtime/plugin/minibufexpl.vim
    "
    " > bufexplorer - http://www.vim.org/scripts/script.php?script_id=42
    " Makes it easy to switch between buffers:
    " info -> :help bufExplorer
    "
    " > yankring.vim - http://www.vim.org/scripts/script.php?script_id=1234
    " Emacs's killring, useful when using the clipboard:
    " info -> :help yankring
    "
    " > surround.vim - http://www.vim.org/scripts/script.php?script_id=1697
    " Makes it easy to work with surrounding text:
    " info -> :help surround
    "
    " > snipMate.vim - http://www.vim.org/scripts/script.php?script_id=2540
    " Snippets for many languages (similar to TextMate's):
    " info -> :help snipMate
    "
    " > mru.vim - http://www.vim.org/scripts/script.php?script_id=521
    " Plugin to manage Most Recently Used (MRU) files:
    " info -> :e ~/.vim_runtime/plugin/mru.vim
    "
    " > Command-T - http://www.vim.org/scripts/script.php?script_id=3025
    " Command-T plug-in provides an extremely fast, intuitive mechanism for opening filesa:
    " info -> :help CommandT
    " screencast and web-help -> http://amix.dk/blog/post/19501
    "
    "
    " Revisions:
    " > 3.6: Added lots of stuff (colors, Command-T, Vim 7.3 persistent undo etc.)
    " > 3.5: Paste mode is now shown in status line if you are in paste mode
    " > 3.4: Added mru.vim
    " > 3.3: Added syntax highlighting for Mako mako.vim
    " > 3.2: Turned on python_highlight_all for better syntax
    " highlighting for Python
    " > 3.1: Added revisions ;) and bufexplorer.vim
    "
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => General
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Sets how many lines of history VIM has to remember
    set history=700

    " Enable filetype plugin
    filetype plugin on
    filetype indent on

    " Set to auto read when a file is changed from the outside
    set autoread

    " With a map leader it's possible to do extra key combinations
    " like <leader>w saves the current file
    let mapleader = ","
    let g:mapleader = ","

    " Fast saving
    nmap <leader>w :w!<cr>

    " Fast editing of the .vimrc
    map <leader>e :e! ~/.vim_runtime/vimrc<cr>

    " When vimrc is edited, reload it
    autocmd! bufwritepost vimrc source ~/.vim_runtime/vimrc


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => VIM user interface
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Set 7 lines to the curors - when moving vertical..
    set so=7

    set wildmenu "Turn on WiLd menu

    set ruler "Always show current position

    set cmdheight=2 "The commandbar height

    set hid "Change buffer - without saving

    " Set backspace config
    set backspace=eol,start,indent
    set whichwrap+=<,>,h,l

    set ignorecase "Ignore case when searching
    set smartcase

    set hlsearch "Highlight search things

    set incsearch "Make search act like search in modern browsers
    set nolazyredraw "Don't redraw while executing macros

    set magic "Set magic on, for regular expressions

    set showmatch "Show matching bracets when text indicator is over them
    set mat=2 "How many tenths of a second to blink

    " No sound on errors
    set noerrorbells
    set novisualbell
    set t_vb=
    set tm=500


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => Colors and Fonts
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    syntax enable "Enable syntax hl

    " Set font according to system
    if MySys() == "mac"
    set gfn=Menlo:h14
    set shell=/bin/bash
    elseif MySys() == "windows"
    set gfn=Bitstream\ Vera\ Sans\ Mono:h10
    elseif MySys() == "linux"
    set gfn=Monospace\ 10
    set shell=/bin/bash
    endif

    if has("gui_running")
    set guioptions-=T
    set t_Co=256
    set background=dark
    colorscheme peaksea
    set nonu
    else
    colorscheme zellner
    set background=dark

    set nonu
    endif

    set encoding=utf8
    try
    lang en_US
    catch
    endtry

    set ffs=unix,dos,mac "Default file types


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => Files, backups and undo
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Turn backup off, since most stuff is in SVN, git anyway...
    set nobackup
    set nowb
    set noswapfile

    "Persistent undo
    try
    if MySys() == "windows"
    set undodir=C:\Windows\Temp
    else
    set undodir=~/.vim_runtime/undodir
    endif

    set undofile
    catch
    endtry


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => Text, tab and indent related
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    set expandtab
    set shiftwidth=4
    set tabstop=4
    set smarttab

    set lbr
    set tw=500

    set ai "Auto indent
    set si "Smart indet
    set wrap "Wrap lines


    """"""""""""""""""""""""""""""
    " => Visual mode related
    """"""""""""""""""""""""""""""
    " Really useful!
    " In visual mode when you press * or # to search for the current selection
    vnoremap <silent> * :call VisualSearch('f')<CR>
    vnoremap <silent> # :call VisualSearch('b')<CR>

    " When you press gv you vimgrep after the selected text
    vnoremap <silent> gv :call VisualSearch('gv')<CR>
    map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left>


    function! CmdLine(str)
    exe "menu Foo.Bar :" . a:str
    emenu Foo.Bar
    unmenu Foo
    endfunction

    " From an idea by Michael Naumann
    function! VisualSearch(direction) range
    let l:saved_reg = @"
    execute "normal! vgvy"

    let l:pattern = escape(@", '\\/.*$^~[]')
    let l:pattern = substitute(l:pattern, "\n$", "", "")

    if a:direction == 'b'
    execute "normal ?" . l:pattern . "^M"
    elseif a:direction == 'gv'
    call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.')
    elseif a:direction == 'f'
    execute "normal /" . l:pattern . "^M"
    endif

    let @/ = l:pattern
    let @" = l:saved_reg
    endfunction



    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => Command mode related
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Smart mappings on the command line
    cno $h e ~/
    cno $d e ~/Desktop/
    cno $j e ./
    cno $c e <C-\>eCurrentFileDir("e")<cr>

    " $q is super useful when browsing on the command line
    cno $q <C-\>eDeleteTillSlash()<cr>

    " Bash like keys for the command line
    cnoremap <C-A> <Home>
    cnoremap <C-E> <End>
    cnoremap <C-K> <C-U>

    cnoremap <C-P> <Up>
    cnoremap <C-N> <Down>

    " Useful on some European keyboards
    map ½ $
    imap ½ $
    vmap ½ $
    cmap ½ $


    func! Cwd()
    let cwd = getcwd()
    return "e " . cwd
    endfunc

    func! DeleteTillSlash()
    let g:cmd = getcmdline()
    if MySys() == "linux" || MySys() == "mac"
    let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "")
    else
    let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "")
    endif
    if g:cmd == g:cmd_edited
    if MySys() == "linux" || MySys() == "mac"
    let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "")
    else
    let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "")
    endif
    endif
    return g:cmd_edited
    endfunc

    func! CurrentFileDir(cmd)
    return a:cmd . " " . expand("%:p:h") . "/"
    endfunc


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => Moving around, tabs and buffers
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Map space to / (search) and c-space to ? (backgwards search)
    map <space> /
    map <c-space> ?
    map <silent> <leader><cr> :noh<cr>

    " Smart way to move btw. windows
    map <C-j> <C-W>j
    map <C-k> <C-W>k
    map <C-h> <C-W>h
    map <C-l> <C-W>l

    " Close the current buffer
    map <leader>bd :Bclose<cr>

    " Close all the buffers
    map <leader>ba :1,300 bd!<cr>

    " Use the arrows to something usefull
    map <right> :bn<cr>
    map <left> :bp<cr>

    " Tab configuration
    map <leader>tn :tabnew<cr>
    map <leader>te :tabedit
    map <leader>tc :tabclose<cr>
    map <leader>tm :tabmove

    " When pressing <leader>cd switch to the directory of the open buffer
    map <leader>cd :cd %:p:h<cr>


    command! Bclose call <SID>BufcloseCloseIt()
    function! <SID>BufcloseCloseIt()
    let l:currentBufNum = bufnr("%")
    let l:alternateBufNum = bufnr("#")

    if buflisted(l:alternateBufNum)
    buffer #
    else
    bnext
    endif

    if bufnr("%") == l:currentBufNum
    new
    endif

    if buflisted(l:currentBufNum)
    execute("bdelete! ".l:currentBufNum)
    endif
    endfunction

    " Specify the behavior when switching between buffers
    try
    set switchbuf=usetab
    set stal=2
    catch
    endtry


    """"""""""""""""""""""""""""""
    " => Statusline
    """"""""""""""""""""""""""""""
    " Always hide the statusline
    set laststatus=2

    " Format the statusline
    set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c


    function! CurDir()
    let curdir = substitute(getcwd(), '/Users/amir/', "~/", "g")
    return curdir
    endfunction

    function! HasPaste()
    if &paste
    return 'PASTE MODE '
    else
    return ''
    endif
    endfunction


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => Parenthesis/bracket expanding
    """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    vnoremap $1 <esc>`>a)<esc>`<i(<esc>
    vnoremap $2 <esc>`>a]<esc>`<i[<esc>
    vnoremap $3 <esc>`>a}<esc>`<i{<esc>
    vnoremap $$ <esc>`>a"<esc>`<i"<esc>
    vnoremap $q <esc>`>a'<esc>`<i'<esc>
    vnoremap $e <esc>`>a"<esc>`<i"<esc>

    " Map auto complete of (, ", ', [
    inoremap $1 ()<esc>i
    inoremap $2 []<esc>i
    inoremap $3 {}<esc>i
    inoremap $4 {<esc>o}<esc>O
    inoremap $q ''<esc>i
    inoremap $e ""<esc>i
    inoremap $t <><esc>i


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => General Abbrevs
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    iab xdate <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => Editing mappings
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    "Remap VIM 0
    map 0 ^

    "Move a line of text using ALT+[jk] or Comamnd+[jk] on mac
    nmap <M-j> mz:m+<cr>`z
    nmap <M-k> mz:m-2<cr>`z
    vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
    vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z

    if MySys() == "mac"
    nmap <D-j> <M-j>
    nmap <D-k> <M-k>
    vmap <D-j> <M-j>
    vmap <D-k> <M-k>
    endif

    "Delete trailing white space, useful for Python ;)
    func! DeleteTrailingWS()
    exe "normal mz"
    %s/\s\+$//ge
    exe "normal `z"
    endfunc
    autocmd BufWrite *.py :call DeleteTrailingWS()

    set guitablabel=%t


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => Cope
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Do :help cope if you are unsure what cope is. It's super useful!
    map <leader>cc :botright cope<cr>
    map <leader>n :cn<cr>
    map <leader>p :cp<cr>


    """"""""""""""""""""""""""""""
    " => bufExplorer plugin
    """"""""""""""""""""""""""""""
    let g:bufExplorerDefaultHelp=0
    let g:bufExplorerShowRelativePath=1
    map <leader>o :BufExplorer<cr>


    """"""""""""""""""""""""""""""
    " => Minibuffer plugin
    """"""""""""""""""""""""""""""
    let g:miniBufExplModSelTarget = 1
    let g:miniBufExplorerMoreThanOne = 2
    let g:miniBufExplModSelTarget = 0
    let g:miniBufExplUseSingleClick = 1
    let g:miniBufExplMapWindowNavVim = 1
    let g:miniBufExplVSplit = 25
    let g:miniBufExplSplitBelow=1

    let g:bufExplorerSortBy = "name"

    autocmd BufRead,BufNew :call UMiniBufExplorer

    map <leader>u :TMiniBufExplorer<cr>


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => Omni complete functions
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    autocmd FileType css set omnifunc=csscomplete#CompleteCSS


    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => Spell checking
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    "Pressing ,ss will toggle and untoggle spell checking
    map <leader>ss :setlocal spell!<cr>

    "Shortcuts using <leader>
    map <leader>sn ]s
    map <leader>sp [s
    map <leader>sa zg
    map <leader>s? z=


    """"""""""""""""""""""""""""""
    " => Python section
    """"""""""""""""""""""""""""""
    let python_highlight_all = 1
    au FileType python syn keyword pythonDecorator True None False self

    au BufNewFile,BufRead *.jinja set syntax=htmljinja
    au BufNewFile,BufRead *.mako set ft=mako

    au FileType python inoremap <buffer> $r return
    au FileType python inoremap <buffer> $i import
    au FileType python inoremap <buffer> $p print
    au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi
    au FileType python map <buffer> <leader>1 /class
    au FileType python map <buffer> <leader>2 /def
    au FileType python map <buffer> <leader>C ?class
    au FileType python map <buffer> <leader>D ?def


    """"""""""""""""""""""""""""""
    " => JavaScript section
    """""""""""""""""""""""""""""""
    au FileType javascript call JavaScriptFold()
    au FileType javascript setl fen
    au FileType javascript setl nocindent

    au FileType javascript imap <c-t> AJS.log();<esc>hi
    au FileType javascript imap <c-a> alert();<esc>hi

    au FileType javascript inoremap <buffer> $r return
    au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi

    function! JavaScriptFold()
    setl foldmethod=syntax
    setl foldlevelstart=1
    syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend

    function! FoldText()
    return substitute(getline(v:foldstart), '{.*', '{...}', '')
    endfunction
    setl foldtext=FoldText()
    endfunction


    """"""""""""""""""""""""""""""
    " => MRU plugin
    """"""""""""""""""""""""""""""
    let MRU_Max_Entries = 400
    map <leader>f :MRU<CR>


    """"""""""""""""""""""""""""""
    " => Command-T
    """"""""""""""""""""""""""""""
    let g:CommandTMaxHeight = 15
    set wildignore+=*.o,*.obj,.git,*.pyc
    noremap <leader>j :CommandT<cr>
    noremap <leader>y :CommandTFlush<cr>


    """"""""""""""""""""""""""""""
    " => Vim grep
    """"""""""""""""""""""""""""""
    let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated'
    set grepprg=/bin/grep\ -nH



    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " => MISC
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Remove the Windows ^M - when the encodings gets messed up
    noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm

    "Quickly open a buffer for scripbble
    map <leader>q :e ~/buffer<cr>
    au BufRead,BufNewFile ~/buffer iab <buffer> xh1 ===========================================

    map <leader>pp :setlocal paste!<cr>

    map <leader>bb :cd ..<cr>
    主站蜘蛛池模板: 亚洲成A人片在线观看中文| 无码一区二区三区AV免费| 亚洲AV网站在线观看| 亚洲成a人片在线观看天堂无码| 久久99精品国产免费观看| 亚洲男人都懂得羞羞网站| 国产亚洲精品免费视频播放| 亚洲熟伦熟女新五十路熟妇 | 亚洲精品一级无码中文字幕| 国产精品亚洲精品爽爽| 亚洲 国产 图片| 全部在线播放免费毛片| 亚洲人成人无码网www电影首页| 在线免费观看伊人三级电影| 国产AV无码专区亚洲AV毛网站 | 野花高清在线电影观看免费视频 | 亚洲国产综合无码一区二区二三区 | 香蕉视频免费在线| 亚洲熟妇无码AV在线播放| 中文字幕在线视频免费观看| 久久99国产亚洲高清观看首页| 污污网站免费观看| 亚洲无吗在线视频| 国产成人免费A在线视频| jizz免费在线观看| 亚洲高清中文字幕综合网| 免费看美女裸露无档网站| 最新亚洲人成无码网站| 国产a v无码专区亚洲av| 色欲国产麻豆一精品一AV一免费| 亚洲中文无码av永久| www国产亚洲精品久久久| a级在线观看免费| 亚洲人成激情在线播放| 亚洲高清成人一区二区三区| 免费在线看黄的网站| 国产精品高清视亚洲一区二区 | 免费v片在线观看品善网| 在线观看肉片AV网站免费| 亚洲精品中文字幕无乱码麻豆| 亚洲国产免费综合|