• Stars
    star
    431
  • Rank 100,866 (Top 2 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Vim support for editing fish scripts

vim-fish

This is an addon for Vim providing support for editing fish scripts.

Features aplenty

  • Syntax highlighting and filetype detection, of course.
  • Automatic indentation based on keywords for control structures.
  • Automatic folds for everything that end terminates in fish.
  • Code formatting with fish_indent using the gq operator.
  • Jumping to file in fish's function path that defines the function under the cursor using the gf command.
  • Searching for definitions including sourced files using commands like [i.
  • Keyword lookup that includes pages for fish builtins using the K command.
  • Completions from fish using the ^X^O command.
  • Syntax checking with quickfix using the :make command.
  • Improved funced experience using commands like S to instantly start typing commands in the function body.
  • Mimics funced when manually creating new functions.
  • Automatic formatting of comments.

For everything above to work you need to have fish installed in $PATH and some Vim features turned on. First, tell Vim to use the syntax and filetype functionality, normally in your ~/.vimrc:

syntax enable
filetype plugin indent on

Next, set some options for the fish filetype. You can do this either by prefixing each line with autocmd FileType fish, or by putting them in your own ~/.vim/ftplugin/fish.vim file:

" Set up :make to use fish for syntax checking.
compiler fish

" Set this to have long lines wrap inside comments.
setlocal textwidth=79

" Enable folding of block structures in fish.
setlocal foldmethod=expr

To make the folds more pleasant to work with you might also want to tweak settings like foldlevelstart and foldminlines, which you could do either globally in your ~/.vimrc or locally as described above.

A team player

vim-fish ships with:

But you don't have to install any of those to use this addon.

Teach a Vim to fishโ€ฆ

Vim needs a more POSIX compatible shell than fish for certain functionality to work, such as :%!, compressed help pages and many third-party addons. If you use fish as your login shell or launch Vim from fish, you need to set shell to something else in your ~/.vimrc, for example:

if &shell =~# 'fish$'
    set shell=sh
endif

Best do it somewhere at the top, before any addon code is loaded and executed.

Note that this also affects what :sh[ell] launches, so if you care about that you might want to set it to your second best shell instead. If you use Vim in the terminal you could also train yourself to use :st[op] or CTRL-Z instead and then fg in fish to get back to Vim.

More Repositories

1

vim2hs

vim2hs :: Vim -> Haskell
Vim Script
340
star
2

attest

Modern, Pythonic test automation
Python
100
star
3

all-about-monads

Attempt to port All About Monads to HaskellWiki
Haskell
54
star
4

flask-zodb

Use the ZODB with Flask
Python
41
star
5

amazing

an amazing widget manager for an awesome window manager
Ruby
25
star
6

flask-genshi

Genshi templating for Flask
Python
20
star
7

ruby-statgrab

Ruby bindings to the libstatgrab portable system statistics library
C
12
star
8

jbo

Use jbovlaste on the command line, offline.
Python
9
star
9

makfa-cli

Dependency-light (Python with batteries) single-file command-line makfa Lojban dictionary.
8
star
10

vlasisku

CSS
6
star
11

kibr

JVS2 Forever
Haskell
5
star
12

dotfiles

Vim Script
5
star
13

visual-camxes

JavaScript
5
star
14

path

Haskell
5
star
15

warp

DRY up your static hypertext
4
star
16

HUnit-Diff

Haskell
4
star
17

makfa

Supybot configs and plugins for the makfa lojban bot
Python
3
star
18

happstack-session

Haskell
3
star
19

flask-attest

Test Flask applications with Attest
Python
3
star
20

happaste

Haskell
2
star
21

bob

Bob is a generic source-and-binary-based package manager and builder
Ruby
2
star
22

wokkel4r

Abstractions on top of XMPP4R for a Wokkel (Twisted) like API
Ruby
2
star
23

happstack-yui

Moved to darcs
Haskell
2
star
24

data-lens-ixset

Haskell
2
star
25

cilre

Learn Lojban, already.
JavaScript
2
star
26

irc4r

IRC for Ruby
Ruby
2
star
27

kib

Ruby
2
star
28

heist-highlighter

Haskell
2
star
29

jbojme

Ruby
2
star
30

relvlast

Python
2
star
31

genshi

Python
2
star
32

detest

Python
2
star
33

cleaning-lady

Ruby
2
star
34

flatland

Python
1
star
35

perjury

1
star
36

rpmbuild

1
star
37

flask-sassy

Sassy CSS for Flask with pyScss
Python
1
star
38

braindump

Ideas and Experiments
Python
1
star
39

vim-hare

DANGER don't use this yet
Vim Script
1
star
40

vim-haskell

Vim Script
1
star
41

euler

Learning math and new programming languages by solving the Euler problems
Perl
1
star
42

rag

Python
1
star
43

stutuz

Prototypical foundation for a Lojban web infrastructure with a focus on Jbovlaste 2.
Python
1
star
44

dag.github.com

JavaScript
1
star
45

nox

Python
1
star
46

lojban-irc-stats

IRC statistics for #lojban on FreeNode
Perl
1
star