1
0
mirror of https://github.com/gryf/.vim.git synced 2025-12-17 19:40:29 +01:00

Replaced snipmate with UltiSnips, changed default font to DejaVu Mono

This commit is contained in:
2013-03-23 18:19:23 +01:00
parent e5369406eb
commit 2af24011b1
10 changed files with 368 additions and 5 deletions

3
.hgsub
View File

@@ -7,7 +7,8 @@ bundle/ft_git_pydoc = [git]https://github.com/fs111/pydoc.vim.git
bundle/git_vcscommand = [git]http://repo.or.cz/r/vcscommand.git
bundle/git_tagbar = [git]https://github.com/majutsushi/tagbar.git
bundle/git_surround = [git]https://github.com/tpope/vim-surround.git
bundle/git_snipmate = [git]https://github.com/msanders/snipmate.vim.git
#bundle/git_snipmate = [git]https://github.com/msanders/snipmate.vim.git
bundle/git_ultisnips = [git]https://github.com/SirVer/ultisnips.git
bundle/git_repeat = [git]https://github.com/tpope/vim-repeat.git
bundle/git_nerdcommenter = [git]https://github.com/scrooloose/nerdcommenter.git
bundle/git_ctrlp = [git]https://github.com/kien/ctrlp.vim.git

View File

@@ -9,11 +9,11 @@ f6d93b8788b57990a2669b2408004c0086d6a878 bundle/git_fugitive
4c376a8061fa335228da420937ce385b847dd56a bundle/git_gundo
0b3d928dce8262dedfc2f83b9aeb59a94e4f0ae4 bundle/git_nerdcommenter
a81bef76031ca1c71766b516417480caeb01c932 bundle/git_repeat
f5a75d075d3c005ebe69e3f5e56cf99516e8aa3b bundle/git_snipmate
02199ea0080d744ec76b79d74ce56d51d25cf7ae bundle/git_surround
75a234231ba0c43883e0a84c48caf3acc1229a0e bundle/git_syntastic
cc222f5d8c22825af2906453ebe3833dfa670689 bundle/git_tagbar
73e67619cd3b8de34608a0e410e580587d6bcfea bundle/git_taglisttoo
971778b93a4a46a27477935b4f4a2568c778e884 bundle/git_ultisnips
bffbab0357b89fed164dbe114649c9d82993ee1a bundle/git_vcscommand
6049b8f79a23d391ff6d6712efd4ab551f8df51a bundle/git_vim-javascript
1e2f98f4366c6dec27fa8df72971fa9fa33e9f07 bundle/git_vim-nodejs-complete

6
.vimrc
View File

@@ -61,7 +61,7 @@ set wildmenu "Put command-line completion in an enhanced
set wrapmargin=1 "Number of characters from the right window border where wrapping starts
set textwidth=78
set cc=+1
set colorcolumn=+1
"backup/writeback/swapfile
set nobackup
@@ -406,13 +406,13 @@ if has('gui_running')
" I like this font, but it looks like crap on linux
"set guifont=Consolas\ 12
" at least, some ttf font that looks good
"set guifont=DejaVu\ Sans\ Mono\ 12
set guifont=DejaVu\ Sans\ Mono\ 12
" Unfortunately there is a problem with TTF fonts in my gvim instance.
" After editing a while there are some leaving trash appearing on the
" buffer. Refreshing the screen helps, but is kinda annoying. It is
" probably my X11 setup, because on other similar workstations and setup I
" didn't noticed such behavior. Fallback to fixed-misc for a while.
set guifont=Fixed\ 14
"set guifont=Fixed\ 14
set mouse=a "Enable mouse support
" No toolbar, menu, scrollbars, draw simple text tabs. This would keep
" window in one place, and also this will conserve space. Tabs are huge

25
UltiSnips/all.snippets Normal file
View File

@@ -0,0 +1,25 @@
snippet date "Current date"
`!v strftime("%Y-%m-%d")`
endsnippet
snippet datetime "Current datetime"
`!v strftime("%Y-%m-%d %H:%M:%S")`
endsnippet
snippet - "a dash, used for concatenating words"
endsnippet
snippet ~ "shy, used for hyphenation hints"
­
endsnippet
snippet fn "filename"
`!v expand("%")`
endsnippet
snippet fp "full path filename"
`!v expand("%:p")`
endsnippet
# vim:ft=snippets:

View File

@@ -0,0 +1,33 @@
snippet dbg "put debugger line"
debugger;
endsnippet
snippet ass "console assert abbrv"
console.assert(${1:condition}, ${2:})${3:};
endsnippet
snippet log "console log abbrv"
console.log('${1:text_msg}'${2:, value})${3:};
endsnippet
snippet debug "console debug abbrv"
console.debug('${1:text_msg}'${2:, value})${3:};
endsnippet
snippet info "console info abbrv"
console.info('${1:text_msg}'${2:, value})${3:};
endsnippet
snippet warn "console warn abbrv"
console.warn('${1:text_msg}'${2:, value})${3:};
endsnippet
snippet tbl "console log in table manner"
console.table('${1:text_msg}'${2:, obj})${3:};
endsnippet
snippet str "use strict" !b
"use strict";
endsnippet
# vim:ft=snippets:

45
UltiSnips/python.snippets Normal file
View File

@@ -0,0 +1,45 @@
snippet dbg "IPython Debugger abbrv" !b
import ipdb; ipdb.set_trace()
endsnippet
snippet pdb "pdb abbrv" !b
import pdb; pdb.set_trace()
endsnippet
snippet docmodule "Doc module" !b
"""
Project: ${1:pyGTKtalog}
Description: ${2:Tests for DataBase class.}
Type: ${3:test}
Author: ${4:Roman 'gryf' Dobosz, gryf73@gmail.com}
Created: ${5:`strftime("%Y-%m-%d %H:%M:%S")`}
"""
endsnippet docmodule
snippet debug "Logging debug message"
LOG.debug(self.${1:method_name}.__doc__.strip())
endsnippet
snippet pywin "PyWin debugger"
import pywin.debugger; pywin.debugger.set_trace()
endsnippet
snippet edbg "Eclipse debbuger"
import sys
pydevdPath = r"/home/share/data/IDE/eclipse/plugins/org.python.pydev.debug_1.6.5.2011020317/pysrc"
if not pydevdPath in sys.path:
sys.path.append(pydevdPath)
import pydevd
pydevd.settrace()
endsnippet
snippet msg "Tk graphical message"
from Tkinter import Tk
import ttk
import tkMessageBox
window = Tk()
window.wm_withdraw() # make window invisible. we only want message boxes
ttk.Style().theme_use('clam')
tkMessageBox.showinfo(title="${1:title}", message="${2:msg}", parent=window)
endsnippet
# vim:ft=snippets:

130
UltiSnips/rst.snippets Normal file
View File

@@ -0,0 +1,130 @@
snippet author
:Author: ${1:}|${2:file-as}|${3:aut}
endsnippet
snippet creator
:Creator: ${1:}|${2:file-as}|${3:aut}
endsnippet
snippet contributor
:Contributor: ${1:}|${2:file-as}|${3:ill}
endsnippet
snippet organization
:Organization: ${1:}
endsnippet
snippet address
:Address: ${1:}
endsnippet
snippet contact
:Contact: ${1:}
endsnippet
snippet version
:Version: ${1:}
endsnippet
snippet revision
:Revision: ${1:}
endsnippet
snippet status
:Status: ${1:}
endsnippet
snippet copyright
:Copyright: ${1:}
endsnippet
snippet rights reST tag
:Rights: ${1:}
endsnippet
snippet type
:Type: ${1:}
endsnippet
snippet language
:Language: ${1:en}
endsnippet
snippet title
:Title: ${1:title}
endsnippet
snippet Description
:Description: ${1:}
endsnippet
snippet publisher
:Publisher: ${1:}
endsnippet
snippet pubdate
:Date: ${1:2001-02-01}
endsnippet
snippet format
:Format: ${1:}
endsnippet
snippet identifier
:Identifier: ${1:}
endsnippet
snippet source
:Source: ${1:}
endsnippet
snippet relation
:Relation: ${1:}
endsnippet
snippet coverage
:Coverage: ${1:}
endsnippet
snippet rights
:Rights: ${1:}
endsnippet
snippet subject
:Subject: ${1:}
endsnippet
snippet code
.. sourcecode:: ${1:python}
:cssclass: ${2:wombat}
${3::linenos:} ${4:1}
${5:}
endsnippet
snippet figure
.. figure:: ${1:image.png}
:target: ${1:}
:alt: ${2:description}
:figclass: ${3:custclass}
${2:}
endsnippet
snippet article
:Title: ${1:Blog post title}
:Date: ${2:`!v strftime("%Y-%m-%d %H:%M:%S")`}
:Modified: ${3:}
:Tags: ${4:blogtag1, blogtag2}
${5:}
.. more
endsnippet
snippet raw
.. raw:: html
${1:}
endsnippet

88
UltiSnips/spyce.snippets Normal file
View File

@@ -0,0 +1,88 @@
snippet #!
#!/usr/bin/python
snippet imp
import ${1:module}
# Module Docstring
snippet docs
'''
File: ${1:`Filename('$1.py', 'foo.py')`}
Author: ${2:`g:snips_author`}
Description: ${3}
'''
snippet wh
while ${1:condition}:
${2:# code...}
snippet for
for ${1:needle} in ${2:haystack}:
${3:# code...}
# New Class
snippet cl
class ${1:ClassName}(${2:object}):
"""${3:docstring for $1}"""
def __init__(self, ${4:arg}):
${5:super($1, self).__init__()}
self.$4 = $4
${6}
# New Function
snippet def
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
"""${3:docstring for $1}"""
${4:pass}
snippet deff
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
${3}
# New Method
snippet defs
def ${1:mname}(self, ${2:arg}):
${3:pass}
# New Property
snippet property
def ${1:foo}():
doc = "${2:The $1 property.}"
def fget(self):
${3:return self._$1}
def fset(self, value):
${4:self._$1 = value}
# Lambda
snippet ld
${1:var} = lambda ${2:vars} : ${3:action}
snippet .
self.
snippet try Try/Except
try:
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
snippet try Try/Except/Else
try:
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
else:
${5:pass}
snippet try Try/Except/Finally
try:
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
finally:
${5:pass}
snippet try Try/Except/Else/Finally
try:
${1:pass}
except ${2:Exception}, ${3:e}:
${4:raise $3}
else:
${5:pass}
finally:
${6:pass}
# if __name__ == '__main__':
snippet ifmain
if __name__ == '__main__':
${1:main()}
# __magic__
snippet _
__${1:init}__${2}
snippet dbg
import pywin.debugger; pywin.debugger.set_trace()

29
UltiSnips/tex.snippets Normal file
View File

@@ -0,0 +1,29 @@
snippet li "Item in itemize list"
\item ${VISUAL}$0
endsnippet
snippet lst "Code Listing for listings package" !b
\begin{lstlisting}
${VISUAL}$0
\end{lstlisting}
endsnippet
snippet hrefoot "Make hyper ref with footnote"
\href{$2}{${VISUAL}${1:name}}\footnote{\url{${2:url}}}.$0
endsnippet
snippet href "Make hyperlink"
\href{$2}{${VISUAL}${1:name}}.$0
endsnippet
snippet subsec "Subsection" !b
\subsection{${VISUAL}${1:name}}$0
endsnippet
snippet sss "Sub subsection" !b
\subsubsection{${VISUAL}${1:name}}$0
endsnippet
snippet tt "Make text monospaced"
\texttt{${VISUAL}}$0
endsnippet

12
UltiSnips/xhtml.snippets Normal file
View File

@@ -0,0 +1,12 @@
snippet xhtml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ops="http://www.idpf.org/2007/ops" xml:lang="en">
<head>
<title>${1:title}</title>
<link href="css/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
${2:end}
</body>
</head>