Comments (5)
Initial work pushed to development in 6363b5134ee92613cf13abf2f23c9379e035ce01. It has since been merged to master but remains an undocumented "hidden feature." Here's the commit message:
CreateNewVimHook command
First argument is an event type. This is tab-completed. Second (optional)
argument is a regex pattern. The plugin will build the actual matching
pattern as follows:
let matchingPattern = '\v^' . YOUR_PATTERN . '$'
However, there still isn't a generalizable way of naming VimHook scripts
that are intended support arbitrary regex patterns outisde of the global-,
extension-, and filename-specific use cases. Currently, the CreateNewVimHook
command just names the hook file as it would any other filename-specific
hook file:
FILENAME.vimhook.sh
Two problems with this:
1. The extension need not necessarily be ".sh"
2. Although this VimHook will trigger according to the arbitrary regex pattern
passed to the CreateNewVimHook command, when the current Vim session is
closed that information is lost. When a new Vim session is opened, the
plugin will of course just assume that this is a filename-specific
VimHook as its naming pattern indicates.
from vim-hooks.
Could possibly overcome this with #36.
from vim-hooks.
Would be nice if there were a variant on this command to add the vimhook.bufferoutput
option key since I use that one a lot while building small programs from scratch.
from vim-hooks.
The more I consider this the more I'm leaning towards just creating a handful of convenience commands to cover the most common cases. Something like
- CreateBabelHook
- CreatePythonHook
- CreateNodeHook
- CreateRubyHook
- etc.
It would be a lot more convenient for the user than having to remember the arguments to some generic hook-creating function. Of course they'd all just be thin wrappers for the generic version which a power user could invoke if they wanted. Something like
:CreateVimHook BufWritePost /usr/bin/python bufferoutput
from vim-hooks.
Could provide a second optional arg to provide the filename of the hook. If left off, the hook name will be what I'm using already: the-current-filename.eventname.vimhook.sh
from vim-hooks.
Related Issues (20)
- vimhook.ignore_other_scripts
- Allow option to ListVimHooks in lexicographic order regardless of enabled/disabled state HOT 2
- Add a way to turn off automatic execution but still allow manual HOT 1
- Put full documentation somewhere else other than README HOT 1
- Provide way to run hook in "debug" mode (not asynchronously, not silently) HOT 1
- Option to scroll automatically to bottom of output buffer HOT 1
- :ListVimHooks shows incorrect hook name
- Provide shortcut to close ListVimHooks buffer
- Document how hooks don't run in diff mode HOT 1
- What user is the shell script run as and are there options to change? HOT 2
- Problems with Python virtualenv HOT 2
- Print stderr even if script exits with zero exit code
- Wrong hook name used in message
- Support a human-readable name option to display in status bar
- Allow a config file to define custom hook scripts
- Provide filename sans extension to hook
- matching suffix : support a list
- Update README with crystal clear example of args $1 through $5
- Search recursively upwards for vimhook files
- chmod: No such file or directory
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-hooks.