Browse Source

Changes to be committed:

	modified:   .gitmodules
	modified:   .vimrc
	new file:   autoload/pyclewn.vim
	new file:   bundle/tabline
	new file:   bundle/ultisnips
	new file:   bundle/vim-airline
	modified:   bundle/vim-colorschemes
	deleted:    bundle/vim-snipmate
	modified:   bundle/vim-snippets
	new file:   doc/pyclewn.txt
	new file:   doc/tags
	new file:   macros/.pyclewn_keys.gdb
	new file:   macros/.pyclewn_keys.pdb
	new file:   macros/.pyclewn_keys.simple
	new file:   plugin/pyclewn.vim
	deleted:    syntax/conque_term.vim
	new file:   syntax/dbgvar.vim
wreed4 11 years ago
parent
commit
f01cff18e7

+ 10 - 4
.gitmodules

@@ -18,7 +18,7 @@
 	url = https://github.com/Lokaltog/vim-easymotion.git
 [submodule "bundle/vim-snippets"]
 	path = bundle/vim-snippets
-	url = https://github.com/garbas/vim-snipmate.git
+	url = https://github.com/honza/vim-snippets.git
 [submodule "bundle/matchit"]
 	path = bundle/matchit
 	url = https://github.com/tmhedberg/matchit.git
@@ -31,9 +31,6 @@
 [submodule "bundle/vim-colorschemes"]
 	path = bundle/vim-colorschemes
 	url = https://github.com/flazz/vim-colorschemes.git
-[submodule "bundle/vim-snipmate"]
-	path = bundle/vim-snipmate
-	url = https://github.com/garbas/vim-snipmate.git
 [submodule "bundle/vim-surround"]
 	path = bundle/vim-surround
 	url = https://github.com/tpope/vim-surround.git
@@ -43,3 +40,12 @@
 [submodule "bundle/solarized"]
 	path = bundle/solarized
 	url = https://github.com/altercation/vim-colors-solarized.git
+[submodule "bundle/vim-airline"]
+	path = bundle/vim-airline
+	url = https://github.com/bling/vim-airline.git
+[submodule "bundle/tabline"]
+	path = bundle/tabline
+	url = https://github.com/mkitt/tabline.vim.git
+[submodule "bundle/ultisnips"]
+	path = bundle/ultisnips
+	url = https://github.com/SirVer/ultisnips.git

+ 43 - 1
.vimrc

@@ -24,9 +24,46 @@ let g:tagbar_autofocus = 1
 
 " open Tagbar automatically when viewing a supported file/files
 autocmd VimEnter * nested :call tagbar#autoopen(1)
+" open Tagbar automatically when entering a buffer of supported file/files
+"autocmd BufEnter * nested :call tagbar#autoopen(0)
 
 " Toggle Tagbar
-nnoremap <C-T> :TagbarToggle<CR>
+nnoremap <leader>tt :TagbarToggle<CR>
+
+
+" Airline
+let g:airline#extensions#tabline#enabled = 1
+let g:airline#extensions#tabline#show_tab_nr = 1
+let g:airline#extensions#tabline#tab_nr_type = 1
+
+let g:airline#extensions#tagbar#enabled = 1
+let g:airline#extensions#whitespace#enabled = 0
+
+"NERDTree
+let g:NERDTreeDirArrows = 0
+nnoremap <leader>nt :NERDTreeToggle<CR>
+
+" UltiSnips
+let g:UltiSnipsEditSplit = "vertical"
+let g:UltiSnipsJumpForwardTrigger="<TAB>"
+let g:UltiSnipsJumpBackwardTrigger="<S-TAB>"
+let g:UltiSnipsSnippetsDir="~/.vim/bundle/vim-snippets/UltiSnips"
+
+
+" CCTree
+nnoremap <leader>ct :CCTreeWindowToggle<CR>
+
+" ConqueTerm
+"let g:ConqueTerm_CloseOnEnd = 1
+
+" Pyclewn
+" Only map keys if we're in Pyclewn
+if has("netbeans_enabled")
+    "nmap <silent> <C-p> :exe ":Cprint " .  expand("<cword>")<CR>
+    nmap <silent> <C-p> "pyiw :Cprint <C-R>p<CR>
+    nmap <silent> <C-x> :exe ":Cdbgvar " .  expand("<cword>")<CR>
+    vmap <silent> <C-p> "py :Cprint <C-R>p<CR>
+endif
 
 " }}}
 
@@ -45,6 +82,8 @@ set hlsearch
 set incsearch
 " set status line always on
 set laststatus=2
+" set mouse always on.  I like the mouse sometimes
+set mouse=a
 
 "turn omnicomplete on
 filetype plugin on
@@ -101,6 +140,9 @@ map <C-k> <C-W>k
 map <C-h> <C-W>h
 map <C-l> <C-W>l
 
+" Open tag in new tab
+nnoremap <M-]> <C-W><C-]><C-W>T
+
 " }}}
 
 "{{{ ***** PROJECTS ***** "

+ 187 - 0
autoload/pyclewn.vim

@@ -0,0 +1,187 @@
+" pyclewn run time file
+" Maintainer:   <xdegaye at users dot sourceforge dot net>
+"
+" Configure VIM to be used with pyclewn and netbeans
+"
+if exists("s:did_pyclewn")
+    finish
+endif
+let s:did_pyclewn = 1
+
+let s:start_err = "Error: pyclewn failed to start, "
+let s:start_err .= "run the 'pyclewn' program to get the cause of the problem."
+
+" The following variables define how pyclewn is started when
+" the ':Pyclewn' vim command is run.
+" They may be changed to match your preferences.
+
+let s:pgm = "pyclewn"
+
+if exists("pyclewn_args")
+  let s:args = pyclewn_args
+else
+  let s:args = "--window=top --maxlines=10000 --background=Cyan,Green,Magenta"
+endif
+
+if exists("pyclewn_connection")
+  let s:connection = pyclewn_connection
+else
+  let s:connection = "localhost:3219:changeme"
+endif
+
+" Uncomment the following line to print full traces in a file named 'logfile'
+" for debugging purpose.
+" let s:args .= " --level=nbdebug --file=logfile"
+
+" The 'Pyclewn' command starts pyclewn and vim netbeans interface.
+let s:fixed = "--daemon --editor= --netbeans=" . s:connection . " --cargs="
+
+" Run the 'Cinterrupt' command to open the console
+function s:start_pdb(args)
+    let argl = split(a:args)
+    if index(argl, "--pdb") != -1
+        " find the prefix
+        let prefix = "C"
+        let idx = index(argl, "-x")
+        if idx == -1
+            let idx = index(argl, "--prefix")
+            if idx == -1
+                for item in argl
+                    if stridx(item, "--prefix") == 0
+                        let pos = stridx(item, "=")
+                        if pos != -1
+                            let prefix = strpart(item, pos + 1)
+                        endif
+                    endif
+                endfor
+            endif
+        endif
+
+        if idx != -1 && len(argl) > idx + 1
+            let prefix = argl[idx + 1]
+        endif
+
+        " hack to prevent Vim being stuck in the command line with '--More--'
+        echohl WarningMsg
+        echo "About to run the 'interrupt' command."
+        call inputsave()
+        call input("Press the <Enter> key to continue.")
+        call inputrestore()
+        echohl None
+        exe prefix . "interrupt"
+    endif
+endfunction
+
+" Check wether pyclewn successfully wrote the script file
+function s:pyclewn_ready(filename)
+    let l:cnt = 1
+    let l:max = 20
+    echohl WarningMsg
+    while l:cnt < l:max
+        echon "."
+        let l:cnt = l:cnt + 1
+        if filereadable(a:filename)
+            break
+        endif
+        sleep 200m
+    endwhile
+    echohl None
+    if l:cnt == l:max
+        throw s:start_err
+    endif
+    call s:info("Creation of vim script file \"" . a:filename . "\": OK.\n")
+endfunction
+
+" Start pyclewn and vim netbeans interface.
+function s:start(args)
+    if !exists(":nbstart")
+        throw "Error: the ':nbstart' vim command does not exist."
+    endif
+    if has("netbeans_enabled")
+        throw "Error: netbeans is already enabled and connected."
+    endif
+    if !executable(s:pgm)
+        throw "Error: '" . s:pgm . "' cannot be found or is not an executable."
+    endif
+    let l:tmpfile = tempname()
+
+    " remove console and dbgvar buffers from previous session
+    if bufexists("(clewn)_console")
+        bwipeout (clewn)_console
+    endif
+    if bufexists("(clewn)_dbgvar")
+        bwipeout (clewn)_dbgvar
+    endif
+
+    " start pyclewn and netbeans
+    call s:info("Starting pyclewn.\n")
+    exe "silent !" . s:pgm . " " . a:args . " " . s:fixed . l:tmpfile . " &"
+    call s:info("Running nbstart, <C-C> to interrupt.\n")
+    call s:pyclewn_ready(l:tmpfile)
+    exe "nbstart :" . s:connection
+
+    " source vim script
+    if has("netbeans_enabled")
+        if !filereadable(l:tmpfile)
+            nbclose
+            throw s:start_err
+        endif
+        " the pyclewn generated vim script is sourced only once
+        if ! exists("s:source_once")
+            let s:source_once = 1
+            exe "source " . l:tmpfile
+        endif
+        call s:info("The netbeans socket is connected.\n")
+        call s:start_pdb(a:args)
+    else
+        throw "Error: the netbeans socket could not be connected."
+    endif
+endfunction
+
+function pyclewn#StartClewn(...)
+    " command to start pdb: Pyclewn pdb foo.py arg1 arg2 ....
+    let l:args = s:args
+    if a:0 != 0
+        if a:1 == "pdb"
+            if a:0 == 2 && filereadable(a:2) == 0
+                call s:error("File '" . a:2 . "' is not readable.")
+                return
+            endif
+            let l:args .= " --pdb"
+            if a:0 > 1
+                let l:args .= " --args \"" . join(a:000[1:], ' ') . "\""
+            endif
+        else
+            call s:error("Invalid optional first argument: must be 'pdb'.")
+            return
+        endif
+    endif
+
+    try
+        call s:start(l:args)
+    catch /.*/
+        call s:info("The 'Pyclewn' command has been aborted.\n")
+        call s:error(v:exception)
+        " vim console screen is garbled, redraw the screen
+        if !has("gui_running")
+            redraw!
+        endif
+        " clear the command line
+        echo "\n"
+    endtry
+endfunction
+
+function s:info(msg)
+    echohl WarningMsg
+    echo a:msg
+    echohl None
+endfunction
+
+function s:error(msg)
+    echohl ErrorMsg
+    echo a:msg
+    call inputsave()
+    call input("Press the <Enter> key to continue.")
+    call inputrestore()
+    echohl None
+endfunction

+ 1 - 0
bundle/tabline

@@ -0,0 +1 @@
+Subproject commit 87e40395fdeed63bd14ef68b95404243bece609e

+ 1 - 0
bundle/ultisnips

@@ -0,0 +1 @@
+Subproject commit 4dcfca755b1f6ef20fc5c0b23c9ff60e99ac19a4

+ 1 - 0
bundle/vim-airline

@@ -0,0 +1 @@
+Subproject commit 936e2b6a66b5ddab85676433128792499fac68b0

+ 1 - 1
bundle/vim-colorschemes

@@ -1 +1 @@
-Subproject commit 36ab747f27be95d9f5ebc2439124cddad52763be
+Subproject commit f3ce80759d4cfa9edafe6642d03d8828a5e49d5e

+ 0 - 1
bundle/vim-snipmate

@@ -1 +0,0 @@
-Subproject commit 9db1826a9b197ebe5853138bcdf561c94000fede

+ 1 - 1
bundle/vim-snippets

@@ -1 +1 @@
-Subproject commit 368acf7e2752d6c5914d3f45f938dee6525788a2
+Subproject commit e54c5add591ad547c527894946f3317e1b7e847f

File diff suppressed because it is too large
+ 1563 - 0
doc/pyclewn.txt


+ 37 - 0
doc/tags

@@ -0,0 +1,37 @@
+$cdir	pyclewn.txt	/*$cdir*
+:Pyclewn	pyclewn.txt	/*:Pyclewn*
+C	pyclewn.txt	/*C*
+Cclear	pyclewn.txt	/*Cclear*
+Ccommand	pyclewn.txt	/*Ccommand*
+Cdbgvar	pyclewn.txt	/*Cdbgvar*
+Cdelvar	pyclewn.txt	/*Cdelvar*
+Cdetach	pyclewn.txt	/*Cdetach*
+Cfoldvar	pyclewn.txt	/*Cfoldvar*
+Cinferiortty	pyclewn.txt	/*Cinferiortty*
+Cinterrupt	pyclewn.txt	/*Cinterrupt*
+Cmapkeys	pyclewn.txt	/*Cmapkeys*
+Cquit	pyclewn.txt	/*Cquit*
+Csetfmtvar	pyclewn.txt	/*Csetfmtvar*
+Csymcompletion	pyclewn.txt	/*Csymcompletion*
+Cthreadstack	pyclewn.txt	/*Cthreadstack*
+async-option	pyclewn.txt	/*async-option*
+gdb-balloon	pyclewn.txt	/*gdb-balloon*
+gdb-keys	pyclewn.txt	/*gdb-keys*
+inferior_tty	pyclewn.txt	/*inferior_tty*
+inferiortty	pyclewn.txt	/*inferiortty*
+pdb-keys	pyclewn.txt	/*pdb-keys*
+pdb-pdbrc	pyclewn.txt	/*pdb-pdbrc*
+project-command	pyclewn.txt	/*project-command*
+project-file	pyclewn.txt	/*project-file*
+pyclewn	pyclewn.txt	/*pyclewn*
+pyclewn-console	pyclewn.txt	/*pyclewn-console*
+pyclewn-extending	pyclewn.txt	/*pyclewn-extending*
+pyclewn-gdb	pyclewn.txt	/*pyclewn-gdb*
+pyclewn-intro	pyclewn.txt	/*pyclewn-intro*
+pyclewn-mappings	pyclewn.txt	/*pyclewn-mappings*
+pyclewn-options	pyclewn.txt	/*pyclewn-options*
+pyclewn-pdb	pyclewn.txt	/*pyclewn-pdb*
+pyclewn-using	pyclewn.txt	/*pyclewn-using*
+pyclewn-variable	pyclewn.txt	/*pyclewn-variable*
+pyclewn-windows	pyclewn.txt	/*pyclewn-windows*
+pyclewn.txt	pyclewn.txt	/*pyclewn.txt*

+ 49 - 0
macros/.pyclewn_keys.gdb

@@ -0,0 +1,49 @@
+# .pyclewn_keys.gdb file
+#
+# The default placement for this file is $CLEWNDIR/.pyclewn_keys.gdb, or
+# $HOME/.pyclewn_keys.gdb
+#
+# Key definitions are of the form `KEY:COMMAND'
+# where the following macros are expanded:
+#    ${text}:   the word or selection below the mouse
+#    ${fname}:  the current buffer full pathname
+#    ${lnum}:   the line number at the cursor position
+#
+# All characters following `#' up to the next new line are ignored.
+# Leading blanks on each line are ignored. Empty lines are ignored.
+#
+# To tune the settings in this file, you will have to uncomment them,
+# as well as change them, as the values on the commented-out lines
+# are the default values. You can also add new entries. To remove a
+# default mapping, use an empty GDB command.
+#
+# Supported key names:
+#       . key function: F1 to F20
+#             e.g., `F11:continue'
+#       . modifier (C-,S-,M-) + function key
+#             e.g., `C-F5:run'
+#       . modifier (or modifiers) + character
+#             e.g., `S-Q:quit', `C-S-B:info breakpoints'
+#
+# Note that a modifier is required for non-function keys. So it is not possible
+# to map a lower case character with this method (use the Vim 'map' command
+# instead).
+#
+# C-B : break "${fname}":${lnum} # set breakpoint at current line
+# C-D : down
+# C-E : clear "${fname}":${lnum} # clear breakpoint at current line
+# C-N : next
+# C-P : print ${text}            # print value of selection at mouse position
+# C-U : up
+# C-X : print *${text}           # print value referenced by word at mouse position
+# C-Z : sigint                   # kill the inferior running program
+# S-A : info args
+# S-B : info breakpoints
+# S-C : continue
+# S-F : finish
+# S-L : info locals
+# S-Q : quit
+# S-R : run
+# S-S : step
+# S-W : where
+# S-X : foldvar ${lnum}          # expand/collapse a watched variable

+ 44 - 0
macros/.pyclewn_keys.pdb

@@ -0,0 +1,44 @@
+# .pyclewn_keys.pdb file
+#
+# The default placement for this file is $CLEWNDIR/.pyclewn_keys.pdb, or
+# $HOME/.pyclewn_keys.pdb
+#
+# Key definitions are of the form `KEY:COMMAND'
+# where the following macros are expanded:
+#    ${text}:   the word or selection below the mouse
+#    ${fname}:  the current buffer full pathname
+#    ${lnum}:   the line number at the cursor position
+#
+# All characters following `#' up to the next new line are ignored.
+# Leading blanks on each line are ignored. Empty lines are ignored.
+#
+# To tune the settings in this file, you will have to uncomment them,
+# as well as change them, as the values on the commented-out lines
+# are the default values. You can also add new entries. To remove a
+# default mapping, use an empty GDB command.
+#
+# Supported key names:
+#       . key function: F1 to F20
+#             e.g., `F11:continue'
+#       . modifier (C-,S-,M-) + function key
+#             e.g., `C-F5:run'
+#       . modifier (or modifiers) + character
+#             e.g., `S-Q:quit', `C-S-B:info breakpoints'
+#
+# Note that a modifier is required for non-function keys. So it is not possible
+# to map a lower case character with this method (use the Vim 'map' command
+# instead).
+#
+# C-B : break "${fname}:${lnum}" # set breakpoint at current line
+# C-D : down
+# C-E : clear "${fname}:${lnum}" # clear breakpoint at current line
+# C-N : next
+# C-P : p ${text}                # print value of selection at mouse position
+# C-U : up
+# C-Z : interrupt
+# S-A : args
+# S-B : break
+# S-C : continue
+# S-R : return
+# S-S : step
+# S-W : where

+ 38 - 0
macros/.pyclewn_keys.simple

@@ -0,0 +1,38 @@
+# .pyclewn_keys.simple file
+#
+# The default placement for this file is $CLEWNDIR/.pyclewn_keys.simple, or
+# $HOME/.pyclewn_keys.simple
+#
+# Key definitions are of the form `KEY:COMMAND'
+# where the following macros are expanded:
+#    ${text}:   the word or selection below the mouse
+#    ${fname}:  the current buffer full pathname
+#    ${lnum}:   the line number at the cursor position
+#
+# All characters following `#' up to the next new line are ignored.
+# Leading blanks on each line are ignored. Empty lines are ignored.
+#
+# To tune the settings in this file, you will have to uncomment them,
+# as well as change them, as the values on the commented-out lines
+# are the default values. You can also add new entries. To remove a
+# default mapping, use an empty GDB command.
+#
+# Supported key names:
+#       . key function: F1 to F20
+#             e.g., `F11:continue'
+#       . modifier (C-,S-,M-) + function key
+#             e.g., `C-F5:run'
+#       . modifier (or modifiers) + character
+#             e.g., `S-Q:quit', `C-S-B:info breakpoints'
+#
+# Note that a modifier is required for non-function keys. So it is not possible
+# to map a lower case character with this method (use the Vim 'map' command
+# instead).
+#
+# C-B : break ${fname}:${lnum}   # set breakpoint at current line
+# C-E : clear ${fname}:${lnum}   # clear breakpoint at current line
+# C-P : print ${text}            # print value of selection at mouse position
+# C-Z : interrupt                # interrupt the execution of the target
+# S-C : continue
+# S-Q : quit
+# S-S : step

+ 17 - 0
plugin/pyclewn.vim

@@ -0,0 +1,17 @@
+" pyclewn run time file
+" Maintainer:   <xdegaye at users dot sourceforge dot net>
+"
+" Configure VIM to be used with pyclewn and netbeans
+"
+
+" pyclewn version
+let g:pyclewn_version = "pyclewn-1.11.py2"
+
+" enable balloon_eval
+if has("balloon_eval")
+    set ballooneval
+    set balloondelay=100
+endif
+
+" The 'Pyclewn' command starts pyclewn and vim netbeans interface.
+command -nargs=* -complete=file Pyclewn call pyclewn#StartClewn(<f-args>)

+ 0 - 1
syntax/conque_term.vim

@@ -1 +0,0 @@
-/usr/share/vim-conque/syntax/conque_term.vim

+ 25 - 0
syntax/dbgvar.vim

@@ -0,0 +1,25 @@
+" Vim syntax file
+" Language:	debugger variables window syntax file
+" Maintainer:	<xdegaye at users dot sourceforge dot net>
+" Last Change:	Oct 8 2007
+
+if exists("b:current_syntax")
+    finish
+endif
+
+syn region dbgVarChged display contained matchgroup=dbgIgnore start="={\*}"ms=s+1 end="$"
+syn region dbgDeScoped display contained matchgroup=dbgIgnore start="={-}"ms=s+1 end="$"
+syn region dbgVarUnChged display contained matchgroup=dbgIgnore start="={=}"ms=s+1 end="$"
+
+syn match dbgItem display transparent "^.*$"
+    \ contains=dbgVarUnChged,dbgDeScoped,dbgVarChged,dbgVarNum
+
+syn match dbgVarNum display contained "^\s*\d\+:"he=e-1
+
+high def link dbgVarChged   Special
+high def link dbgDeScoped   Comment
+high def link dbgVarNum	    Identifier
+high def link dbgIgnore	    Ignore
+
+let b:current_syntax = "dbgvar"
+