Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: mfukar/vim-stuff
base: 6f7db4f56b
...
head fork: mfukar/vim-stuff
compare: 9e886544fc
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 14, 2012
Michael Foukarakis Inconsequential nonsense added in powershell.vim. Nothing to see here. 3701dae
Michael Foukarakis Fixed issue #3 for Robot file type.
Replaced `setf` with `setlocal filetype` to override all default file
type checks for *.txt files. I should not be doing this; using .txt
for RF files is a mistake that should not be perpetuated..
08268a8
Michael Foukarakis Changed regexp in robot ft detection. 9e88654
Showing with 45 additions and 20 deletions.
  1. +28 −4 ftdetect/powershell.vim
  2. +17 −16 ftdetect/robot.vim
32 ftdetect/powershell.vim
View
@@ -1,5 +1,29 @@
-" Powershell filetype detection (overrides all default filetype checks)
-" Maintainer: Michael Foukarakis
+"=============================================================================
+" File: ftdetect/powershell.vim
+" Author: Michael Foukarakis
+" Version: 0.1
+" Created: By now, who knows..
+" Last Update: Mon May 14, 2012 09:43 EEST
+"------------------------------------------------------------------------
+" Description:
+" Filetype detection plugin for Powershell files.
+" WARNING:
+" Overrides all default file type checks.
+"------------------------------------------------------------------------
+" Installation:
+" - Requires Vim7+
+" - Drop this file into {rtp}/ftdetect
+" - Use the '# -*- coding: robot -*-' in the first line of robot files
+" or set the g:robot_syntax_for_txt global variable
+" to explicitly tell vim about filetype.
+" History: - Replaced setf with setlocal filetype, much more sane.
+" TODO: Missing features go here.
+"=============================================================================
+let s:cpo_save=&cpo
+set cpo&vim
-au BufRead,BufNewFile *.ps1 set filetype=powershell
-au BufRead,BufNewFile *.psm1 set filetype=powershell
+au BufRead,BufNewFile *.ps1 setlocal filetype=powershell
+au BufRead,BufNewFile *.psm1 setlocal filetype=powershell
+
+" It's that simple.
+let &cpo=s:cpo_save
33 ftdetect/robot.vim
View
@@ -1,20 +1,23 @@
"=============================================================================
-" $Id$
-" File: ftdetect/robot.vim {{{1
+" File: ftdetect/robot.vim
" Author: Michael Foukarakis
-" Version: 0.1
+" Version: 0.2
" Created: Tue 21 Dec 2010 09:08:35 AM EET
-" Last Update: $Date$
+" Last Update: Mon May 14, 2012 09:58 EEST
"------------------------------------------------------------------------
" Description:
-" Filetype detection plugin for Robot files.
+" Filetype detection plugin for Robot files.
+" WARNING:
+" Overrides all default file type checks.
"------------------------------------------------------------------------
" Installation:
-" Drop this file into {rtp}/ftdetect
-" Requires Vim7+
-" History: None yet.
+" - Requires Vim7+
+" - Drop this file into {rtp}/ftdetect
+" - Use the '# -*- coding: robot -*-' in the first line of robot files
+" or set the g:robot_syntax_for_txt global variable
+" to explicitly tell vim about filetype.
+" History: - Replaced setf with setlocal filetype, much more sane.
" TODO: Missing features go here.
-" }}}1
"=============================================================================
let s:cpo_save=&cpo
set cpo&vim
@@ -23,15 +26,13 @@ au BufNewFile,BufRead *.txt call s:FTrobot()
func! s:FTrobot()
let b:topl = getline(1)
- if (exists("g:robot_syntax_for_txt") && g:robot_syntax_for_txt) || b:topl =~ '\*\*\*.\{-}\*\*\*'
- setf robot
- elseif b:topl =~ '^# -\*- coding: robot -\*-$'
- setf robot
- else
- setf human
+ if (exists("g:robot_syntax_for_txt") && g:robot_syntax_for_txt)
+ \ || b:topl =~ '\*\*\*.\{-}\*\*\*'
+ \ || b:topl =~ '^# -\*- coding: robot -\*-$'
+ setlocal filetype=robot
endif
endfunc
"------------------------------------------------------------------------
let &cpo=s:cpo_save
-" vim600: set fdm=marker:
+" vim700: set fdm=marker:

No commit comments for this range

Something went wrong with that request. Please try again.