Commits

Martin Tournoij committed aa042e8

Update

Comments (0)

Files changed (8)

 	bindkey -b N-3 complete-word-raw
 	bindkey -b N-home beginning-of-line
 	bindkey -b N-end end-of-line
+
+	bindkey -b M-x e_copy_to_clipboard
+	bindkey -b M-y e_paste_from_clipboard
 else
 	# F1
 	bindkey ^[[M run-help

home/dot.vim/ftdetect/less.vim

+autocmd BufNewFile,BufRead *.less setf less

home/dot.vim/ftdetect/uzbl.vim

-au BufRead,BufNewFile  .config/uzbl/*  set filetype=uzbl
-au BufRead,BufNewFile  */uzbl/config   set filetype=uzbl

home/dot.vim/ftplugin/less.vim

+" Vim filetype plugin
+" Language:	    LessCSS
+" Author:	    Tim Pope <vimNOSPAM@tpope.org>
+" Maintainer:   Leonard Ehrenfried <leonard.ehrenfried@web.de>
+" Last Change:  2011 Sep 30
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
+
+setlocal iskeyword+=-
+setlocal commentstring=//\ %s
+setlocal define=^\\s*\\%(@mixin\\\|=\\)
+setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
+setlocal omnifunc=csscomplete#CompleteCSS
+setlocal suffixesadd=.less
+setlocal comments=s1:/*,mb:*,ex:*/
+
+let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
+
+" vim:set sw=2:

home/dot.vim/indent/less.vim

+" Vim indent file
+" Language:	    LessCSS
+" Maintainer:	Leonard Ehrenfried <leonard.ehrenfried@web.de>
+" Last Change:	2011 Sep 26
+
+if exists("b:did_indent")
+  finish
+endif
+
+runtime! indent/css.vim
+

home/dot.vim/syntax/less.vim

+if exists("b:current_syntax")
+  finish
+endif
+
+runtime! syntax/css.vim
+runtime! after/syntax/css.vim
+" load files from vim-css3-syntax plugin (https://github.com/hail2u/vim-css3-syntax)
+runtime! after/syntax/css/*.vim
+
+syn case ignore
+
+syn region lessDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssTagName,cssPseudoClass,cssUrl,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,lessDefinition,lessComment,lessClassChar,lessVariable,lessMixinChar,lessAmpersandChar,lessFunction,lessNestedSelector,@cssColors fold
+
+syn match lessVariable "@[[:alnum:]_-]\+" contained
+syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessVariableAssignment skipwhite
+syn match lessVariableAssignment ":" contained nextgroup=lessVariableValue skipwhite
+syn match lessVariableValue ".*;"me=e-1 contained contains=lessVariable,lessOperator,lessDefault,cssValue.*,@cssColors "me=e-1 means that the last char of the pattern is not highlighted
+
+syn match lessOperator "+" contained
+syn match lessOperator "-" contained
+syn match lessOperator "/" contained
+syn match lessOperator "*" contained
+
+syn match lessNestedSelector "[^/]* {"me=e-1 contained contains=cssTagName,cssAttributeSelector,lessAmpersandChar,lessVariable,lessMixinChar,lessFunction,lessNestedProperty
+syn match lessNestedProperty "[[:alnum:]]\+:"me=e-1 contained
+
+syn match lessDefault "!default" contained
+
+syn match lessMixinChar "\.[[:alnum:]_-]\@=" contained nextgroup=lessClass
+syn match lessAmpersandChar "&" contained nextgroup=lessClass,cssPseudoClass
+syn match lessClass "[[:alnum:]_-]\+" contained
+
+" functions {{{
+
+" string functions
+syn keyword lessFunction escape e % containedin=cssDefinition contained
+" misc functions
+syn keyword lessFunction color unit containedin=cssDefinition contained
+" math functions
+syn keyword lessFunction ceil floor percentage round containedin=cssDefinition contained
+" color definition
+syn keyword lessFunction rgb rgba argb hsl hsla hsv hsva containedin=cssDefinition contained
+" color channel information
+syn keyword lessFunction hue saturation lightness red green blue alpha luma containedin=cssDefinition contained
+" color operations
+syn keyword lessFunction saturate desaturate lighten darken fadein fadeout fade spin mix greyscale contrast containedin=cssDefinition contained
+" color blending
+syn keyword lessFunction multiply screen overlay softlight hardlight difference exclusion average negation containedin=cssDefinition contained
+
+" }}}
+
+syn match lessComment "//.*$" contains=@Spell
+
+hi def link lessVariable Special
+hi def link lessVariableValue Constant
+hi def link lessDefault Special
+hi def link lessComment Comment
+hi def link lessFunction Function
+hi def link lessMixinChar Special
+hi def link lessAmpersandChar Special
+hi def link lessNestedProperty Type
+hi def link lessClass PreProc
+
+let b:current_syntax = "less"

home/dot.vim/syntax/uzbl.vim

-" Vim syntax file
-" Language:     Uzbl config syntax
-" Maintainer:   Gregor Uhlenheuer (kongo2002) <kongo2002@gmail.com>
-" Contributors: Mason Larobina <mason.larobina@gmail.com>
-"               Pawel Tomak (grodzik) <pawel.tomak@gmail.com>
-" Version:      0.1
-"
-" Installing:
-" To install this syntax file place it in your `~/.vim/syntax/` directory.
-"
-" To enable automatic uzbl-config file type detection create a new file
-" `~/.vim/ftdetect/uzbl.vim` with the following lines inside:
-"
-"    au BufRead,BufNewFile  ~/.config/uzbl/*  set filetype=uzbl
-"    au BufRead,BufNewFile  */uzbl/config     set filetype=uzbl
-"
-" Issues:
-"   1. Hilighting inside @[]@, @()@, @<>@ and string regions would be nice.
-"   2. Accidentally matches keywords inside strings.
-"
-
-if version < 600
-    syntax clear
-elseif exists("b:current_syntax")
-    finish
-endif
-
-syn keyword uzblKeyword back forward scroll reload reload_ign_cache stop
-syn keyword uzblKeyword zoom_in zoom_out toggle uri script
-syn keyword uzblKeyword spawn sync_spawn sync_sh sync_spawn_exec
-syn keyword uzblKeyword exit search search_reverse search_clear dehilight set
-syn keyword uzblKeyword dump_config dump_config_as_events chain print event
-syn keyword uzblKeyword request menu_add menu_link_add menu_image_add
-syn keyword uzblKeyword menu_editable_add menu_separator menu_link_separator
-syn keyword uzblKeyword menu_image_separator menu_editable_separator
-syn keyword uzblKeyword menu_remove menu_link_remove menu_image_remove
-syn keyword uzblKeyword menu_editable_remove hardcopy include
-
-" Match 'js' and 'sh' only without a dot in front
-syn match uzblKeyword /\.\@<!sh\s\+/
-syn match uzblKeyword /\.\@<!js\s\+/
-
-" Comments
-syn match uzblTodo /TODO:/ contained
-syn region uzblComment display start=/^#/ end=/$/ contains=uzblTodo
-
-" Comment headings
-syn region uzblSec matchgroup=uzblSection start=/^# ===.*$/ end=/^# ===/me=e-5 contains=ALL fold
-syn region uzblSSec matchgroup=uzblSubSection start=/^# ---.*$/ end=/^# [=-]\{3}/me=e-5 contains=ALLBUT,uzblSec,uzblSSec fold
-
-" Integer and float matching
-syn match uzblPercent display /\s[+-]\=\%(\d\+\.\)\=\d\+%\_s/
-syn match uzblInt display /\s[+-]\=\d\+\_s/
-syn match uzblFloat display /\s[+-]\=\d\+\.\d\+\_s/
-
-" Handler arguments
-syn match uzblArgs display /$\d\+/
-
-" Hex colors
-syn match uzblHexCol display /#\x\{3}\%(\x\{3}\)\=/
-
-" Matches @INTERNAL_VAR and @{INTERNAL_VAR}
-syn match uzblInternalExpand display /@[A-Z_]\+/
-syn match uzblInternalExpand display /@{[A-Z_]\+}/
-
-" Matches $ENVIRON_VAR
-syn match uzblEnvironVariable display /$\a\+\w*/
-
-" Matches @some_var and @{some_var}
-syn match uzblExpand display /@[A-Za-z0-9_\.]\+/
-syn match uzblExpand display /@{[A-Za-z0-9_\.]\+}/
-
-" Matches @command_alias at the beginning of a line.
-syn match uzblFunctExpand display /^@[A-Za-z0-9_\.]\+/
-syn match uzblFunctExpand display /^@{[A-Za-z0-9_\.]\+}/
-
-" Matches literal \, \@var and \@{var}
-syn match uzblEscape display /\\\\/
-syn match uzblEscape display /\\@/
-syn match uzblEscape display /\\@[A-Za-z0-9_\.]\+/
-syn match uzblEscape display /\\@{[A-Za-z0-9_\.]\+}/
-
-" Match @[ xml data ]@ regions
-syn region uzblXMLEscape display start=+@\[+ end=+\]@+ end=+$+
-syn region uzblEscape start=+\\@\[+ end=+\]\\@+
-
-" Match @( shell command )@ regions
-syn region uzblShellExec display start=+@(+ end=+)@+ end=+$+
-syn region uzblEscape start=+\\@(+ end=+)\\@+
-
-" Match @< javascript command >@ regions
-syn region uzblJSExec display start=+@<+ end=+>@+ end=+$+
-syn region uzblEscape start=+\\@<+ end=+>\\@+
-
-" Match quoted regions
-syn region uzblString display start=+'+ end=+'+ end=+$+ contains=uzblExpand,uzblEscape,uzblHexCol,uzblArgs,uzblInternalExpand,uzblEnvironVariable,uzblXMLEscape,uzblShellExec,uzblJSExec
-syn region uzblString display start=+"+ end=+"+ end=+$+ contains=uzblExpand,uzblEscape,uzblHexCol,uzblArgs,uzblInternalExpand,uzblEnvironVariable,uzblXMLEscape,uzblShellExec,uzblJSExec
-
-if version >= 508 || !exists("did_uzbl_syn_inits")
-    if version <= 508
-        let did_uzbl_syn_inits = 1
-        command -nargs=+ HiLink hi link <args>
-    else
-        command -nargs=+ HiLink hi def link <args>
-    endif
-
-    HiLink uzblComment Comment
-    HiLink uzblTodo Todo
-
-    HiLink uzblSection SpecialComment
-    HiLink uzblSubSection SpecialComment
-
-    HiLink uzblKeyword Keyword
-
-    HiLink uzblInt Number
-    HiLink uzblPercent Number
-    HiLink uzblFloat Float
-
-    HiLink uzblHexCol Constant
-
-    HiLink uzblArgs Identifier
-
-    HiLink uzblExpand Type
-    HiLink uzblFunctExpand Macro
-    HiLink uzblEnvironVariable Number
-    HiLink uzblInternalExpand Identifier
-
-    HiLink uzblXMLEscape Macro
-    HiLink uzblShellExec Macro
-    HiLink uzblJSExec Macro
-
-    HiLink uzblEscape Special
-
-    HiLink uzblString String
-
-    delcommand HiLink
-endif
-
-let b:current_syntax = 'uzbl'
 """ Functions """
 """""""""""""""""
 " Make directory if it doesn't exist yet
-function! MkdirIfNeeded(dir, flags, permissions)
+fun! MkdirIfNeeded(dir, flags, permissions)
 	if !isdirectory(a:dir)
 		call mkdir(a:dir, a:flags, a:permissions)
 	endif
-endfunction
+endfun
 
 " Map key to toggle an option on/off
-function! MapToggle(key, opt)
+fun! MapToggle(key, opt)
 	let cmd=':set '.a:opt.'! \| set '.a:opt."?\<CR>"
 	exec 'nnoremap '.a:key.' '.cmd
 	exec 'inoremap '.a:key." \<C-O>".cmd
-endfunction
+endfun
 command -nargs=+ MapToggle call MapToggle(<f-args>)
 
+" Replace `} else {' with `}<CR>else {'
+fun! SaneIndent()
+	"silent %s/\(\s*\)}\s*\(else\|catch\)/\1}\r\1\2/g
+	silent! %s/\v(\s*)}\s*(else|catch)/\1}\r\1\2/g
+	execute "normal ''"
+endfun
+
+" Replace `}<CR>else {' with `} else {'
+fun! NotSoSaneIndent()
+	"silent %s/}\_.\(\s*\)\(else\|catch\)/} \2/g
+	silent! %s/\v}\_.(\s*)(else|catch)/} \2/g
+	execute "normal ''"
+endfun
+
 " Are we running on Windows or some UNIX system?
 if has("win32") || has("win64")
 	let uname='win32'
 	let whoami=substitute(system("whoami"), '\n', '', '')
 endif
 
-if hostname =~ "xs1\.nl$"
+if hostname =~ "COMPUTER13"
 	let env="work"
 else
 	let env="personal"
 set encoding=utf-8
 
 " Always use \n
-set fileformat=unix
+set fileformats=unix
 
 " Faster redrawing
 set ttyfast
 set titleold=
 
 " Never beep
-set visualbell
+"set visualbell
 
 " Use blowfish for encrypting files
 if has("cryptv")
 set wildmenu
 
 " Ignore these files in completion
-set wildignore=*.o,*.pyc
+set wildignore=*.o,*.pyc,*.png,*.jpg
 
 " List all matches, only complete when it's unambigious
 set wildmode=list:longest,full
 au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")|execute("normal `\"")|endif
 
 " Syntax breaks less often
-autocmd BufEnter * :syntax sync fromstart
+au BufEnter * :syntax sync fromstart
 
 
 """"""""""""""""""""
 """"""""""""""""""""
 if has("gui_running")
 	" Default width & height
-	set lines=80
-	set columns=80
+	set lines=55
+	set columns=120
 
 	" Activate mouse
 	set mouse=a
 " Tabs don't work well with haskell
 au BufNewFile,BufRead *.hs set expandtab ts=4 sts=4 sw=4
 
+" PHP
+au BufNewFile *.php exe "normal O<?php"
+
 """ Scheme
 let g:is_chicken=1
 
 " Loading GNU configure crap with syntax is way too slow.
 au BufNewFile,BufRead configure set syntax=
 
+" HTML is almost always Twig or Jinja
+au BufNewFile,BufRead *.html set syntax=htmldjango
+
+
 """"""""""""""""""""""
 """ Plugin options """
 """"""""""""""""""""""
 " Off by default
 let g:showmarks_enable=0
 
+let g:CommandTMatchWindowAtTop = 1
+
 
 " (Possibly) check this out:
 " http://www.vim.org/scripts/script.php?script_id=2507