Commits

Evgeny Podjachev committed 71ec894

Updated plugins.

Comments (0)

Files changed (3)

.vim/bundle/fastfileselector/plugin/fastfileselector.vim

 "
 " Usage:		Command :FFS toggles visibility of fast file selector buffer.
 " 				Parameter g:FFS_window_height sets height of search buffer. Default = 15.
-" 				Parameter g:FFS_ignore_list sets list of dirs/files to ignore use Unix shell-style wildcards. Default = ['.*', '*.obj', '*.pdb', '*.res', '*.dll', '*.idb', '*.exe', '*.lib', '*.so'].
+" 				Parameter g:FFS_ignore_list sets list of dirs/files to ignore use Unix shell-style wildcards. Default = ['.*', '*.bak', '~*', '*.obj', '*.pdb', '*.res', '*.dll', '*.idb', '*.exe', '*.lib', '*.so'].
 "				Parameter g:FFS_ignore_case, if set letters case will be ignored during search. On windows default = 1, on unix default = 0.
 "
-" Version:		0.0.1
+" Version:		1.0.0
 "
-" ChangeLog:	0.0.1:	 Initial version.
+" ChangeLog:	1.0.0:	 Initial version.
 "====================================================================================
 
+" TODO:
+" Add list of known file extentions.
+" Show files only with symbols in right order.
+" Fix highlight of \.
+" Try to fix case insensitive search for non ascii characters
+" Fix wrong toggle after exit by :q
+" Remove code before call longest_substring_size
+
 if exists( "g:loaded_FAST_FILE_SELECTOR" )
 	finish
 endif
 endif
 
 if !exists("g:FFS_ignore_list")
-	let g:FFS_ignore_list = ['.*', '*.obj', '*.pdb', '*.res', '*.dll', '*.idb', '*.exe', '*.lib', '*.so']
+	let g:FFS_ignore_list = ['.*', '*.bak', '~*', '*.obj', '*.pdb', '*.res', '*.dll', '*.idb', '*.exe', '*.lib', '*.so']
 endif
 
 if !exists("s:file_list")
 fun <SID>GenFileList()
 python << EOF
 
-from os import walk, getcwd
+from os import walk, getcwdu
 from os.path import join, isfile, abspath, split
 from fnmatch import fnmatch
 
 		p = path[:-1]
 	
 	while not isfile(join(p, 'tags')):
-		p = split(p)[0]
-		if p == '':
+		p, h = split(p)
+		if p == '' or h == '':
 			return None
 
 	return p
 
 	return fileList
 
-wd = getcwd()
+wd = getcwdu()
 path = find_tags(wd)
 if path == None:
 	fileList = scan_dir(wd, vim.eval("g:FFS_ignore_list"))
 	fileList = scan_dir(path, vim.eval("g:FFS_ignore_list"))
 
 if len(fileList) != 0:
-	vim.command("let s:file_list = ['%s']" % "','".join(fileList))
+	vim.command("let s:file_list = ['%s']" % "','".join(map(lambda x: x.encode("utf-8"), fileList)))
 else:
 	vim.command("let s:file_list = []")
 EOF
 	cal append(0,s:user_line)
 	exe 'normal dd$'
 	cal append(1,s:filtered_file_list)
+	exe 'normal! i'
 	autocmd CursorMovedI <buffer> call <SID>OnCursorMovedI()
 endfun
 
 	endif
 endfun
 
+fun <SID>UpdateSyntax(str)
+	" Apply color changes
+	if a:str != ''
+		setlocal syntax=on
+		if g:FFS_ignore_case == 0
+			exe 'syn match Identifier #['.a:str.']#'
+		else
+			exe 'syn match Identifier #['.tolower(a:str).toupper(a:str).']#'
+		endif
+	else
+		setlocal syntax=off
+	endif
+endfun
+
 fun <SID>OnCursorMovedI()
 	let l = getpos(".")[1]
 	if l > 1
 	n1 = len(str1)
 	n2 = len(str2)
 
-	L = [0] * n1 * n2
+	L = [0 for i in range((n1 + 1) * (n2 + 1))]
 
 	res = 0
 	for i in range(n1):
 		for j in range(n2):
 			if str1[i] == str2[j]:
-				ind = i * n2 + j
-				if i == 0 or j == 0:
-					L[ind] = 1
-				else:
-					L[ind] = L[(i - 1) * n2 + (j - 1)] + 1
+				ind = (i + 1) * n2 + (j + 1)
+				L[ind] = L[i * n2 + j] + 1
 				if L[ind] > res:
 					res = L[ind]
 	return res
 
 def check_symbols(s, symbols):
 	res = 0
+	prevSymbol = None
+	prevSymbolPos = -1
 	for i in symbols:
-		if s.find(i) == -1:
-			return res
+		pos = s.find(i)
+		if pos == -1:
+			return 0
+		else:
+			if prevSymbol != None:
+				if pos < prevSymbolPos:
+					pos = s.find(i, pos + 1)
+					if pos == -1:
+						return 0
+					else:
+						res -= 1
+				else:
+					res -= 1
+
+			prevSymbol = i
+			prevSymbolPos = pos
 
 	res -= 1
 
-	res -= (longest_substring_size(s, symbols) - 1)
+	res -= (longest_substring_size(s, symbols) - 1) * 2
 
 	return res
 
 			let s:user_line=str
 			call <SID>OnRefresh()
 			cal winrestview(save_cursor)
+			call <SID>UpdateSyntax(str)
 		endif
 	endif
 endfun
 	exe 'normal Q'
 endfun
 
+fun <SID>OnBufLeave()
+	if s:prev_mode != 'i'
+		exe 'stopinsert'
+	endif
+endfun
+
+fun <SID>OnBufEnter()
+	let s:prev_mode = mode()
+	exe 'startinsert'
+
+	call <SID>OnRefresh()
+endfun
+
 fun! <SID>ToggleFastFileSelectorBuffer()
 	if !exists("s:tm_winnr") || s:tm_winnr==-1
 		exe "bo".g:FFS_window_height."sp FastFileSelector"
 		setlocal buftype=nofile
 		setlocal noswapfile
 
+		let s:prev_mode = mode()
+		exe 'startinsert'
+
+		let s:user_line=''
 		if !exists("s:first_time")
-			let s:user_line=''
 			let s:first_time=1
 
 			autocmd BufUnload <buffer> exe 'let s:tm_winnr=-1'
+			autocmd BufLeave <buffer> call <SID>OnBufLeave()
 			autocmd CursorMoved <buffer> call <SID>OnCursorMoved()
 			autocmd CursorMovedI <buffer> call <SID>OnCursorMovedI()
 			autocmd VimResized <buffer> call <SID>OnRefresh()
-			autocmd BufEnter <buffer> call <SID>OnRefresh()
+			autocmd BufEnter <buffer> call <SID>OnBufEnter()
 		endif
 		
 		cal <SID>GenFileList()

.vim/bundle/yate/plugin/yate.vim

 " 				search string. Autocompletion using history also works by
 " 				<Ctrl-X><Ctrl-U>.
 "
-" Version:		1.2.2
+" Version:		1.2.4
 "
-" ChangeLog:	1.2.2:	Fixed cleaning of search string in some cases.
+" ChangeLog:	1.2.4:	Fixed leaving of insert mode after leaving YATE buffer.
+" 				1.2.3:	Insert mode is default in YATE buffer.
+"				1.2.2:	Fixed cleaning of search string in some cases.
 "
 " 				1.2.1:	History menu (<Ctrl-H>) also works in normal mode.
 "
 	cal <SID>GotoTag('e')
 endfun
 
+fun <SID>OnBufLeave()
+	if s:prev_mode != 'i'
+		exe 'stopinsert'
+	endif
+endfun
+
+fun <SID>OnBufEnter()
+	let s:prev_mode = mode()
+	exe 'startinsert'
+
+	call <SID>PrintTagsList()
+endfun
+
 fun! <SID>ToggleTagExplorerBuffer()
 	if !exists("s:yate_winnr") || s:yate_winnr==-1
 		exe "bo".g:YATE_window_height."sp YATE"
 		setlocal buftype=nofile
 		setlocal noswapfile
 
+		let s:prev_mode = mode()
+		exe 'startinsert'
+
 		if !exists("s:first_time")
 			let s:user_line=''
 			let s:first_time=1
 
 			autocmd BufUnload <buffer> exe 'let s:yate_winnr=-1'
+			autocmd BufLeave <buffer> call <SID>OnBufLeave()
 			autocmd CursorMoved <buffer> call <SID>OnCursorMoved()
 			autocmd CursorMovedI <buffer> call <SID>OnCursorMovedI()
 			autocmd VimResized <buffer> call <SID>PrintTagsList()
-			autocmd BufEnter <buffer> call <SID>PrintTagsList()
+			autocmd BufEnter <buffer> call <SID>OnBufEnter()
 		endif
 		
 		cal <SID>PrintTagsList()
 vnoremap <F9>		<C-C>:UpdateTypesFileOnly<CR>
 inoremap <F9>		<C-O>:UpdateTypesFileOnly<CR>
 
-map <S-F9>			:wa<CR>:make -j2<CR>:!./r<CR>
-noremap <S-F9>		:wa<CR>:make -j2<CR>:!./r<CR>
-vnoremap <S-F9>		<C-C>:wa<CR><C-C>:make -j2<CR><C-C>:!./r<CR>
-inoremap <S-F9>		<C-O>:wa<CR><C-O>:make -j2<CR><C-O>:!./r<CR>
-
-map <F12>			:make clean<CR>
-noremap <F12>		:make clean<CR>
-vnoremap <F12>		<C-C>:make clean<CR>
-inoremap <F12>		<C-O>:make clean<CR>
+map <F10>			:VCSCommit<CR>
+noremap <F10>		:VCSCommit<CR>
+vnoremap <F10>		<C-C>:VCSCommit<CR>
+inoremap <F10>		<C-O>:VCSCommit<CR>
 
 map <F11>			:cwindow<CR>
 noremap <F11>		:cwindow<CR>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.