Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 7 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 30, 2012
@possiblywrong possiblywrong Update README to point back to the master repo. e2323db
@possiblywrong possiblywrong Add some useful notes on what my .vimrc mappings are. a5ab700
@possiblywrong possiblywrong Bare <esc> mapping considered harmful.
In terminal mode there is a major issue whereby the bare
<esc> will cause the cursor keys to be partially interpreted.

This change essentially causes the default mapping for ListPads
to be used for closing the buffer; essentially a toggle.
@possiblywrong possiblywrong More notes on setup. 05eaefe
@possiblywrong possiblywrong Filter out dot files
This allows me to manage my notes using source control, git/mercurial

We skip files that either start with a '.' or the last portion after
the last '\' start with a '.'
When searching grep ignores these anyway so we don't need to filter
what is returned there.

Note: This is probably not Windows safe. If you want it to work on
Win then you'll have to fix it yourself.
Commits on Jan 31, 2012
@possiblywrong possiblywrong Add g:pad_use_terminal_mappings
Setting to 1 allows us to use the terminal mappings regardless
of the gui mode.
@possiblywrong possiblywrong Clear command after answering 'n' to delete
Just redraw in this case.
39 README.mkd
@@ -2,34 +2,23 @@
A quick notetaking plugin for vim.
-It offers a way of managing notes similar to the one in tools like Notational
-Velocity: file management is removed from the notetaking workflow, and creation
-and searching of notes can be done using the same interface. File management is
-abstracted and replaced by searching and sorting facilities. Notes handled by
-vim-pad are free-form: the plugin doesn't impose any format, and has utilities
-to handle notes in several formats. You can use it along other notetaking
-plugins for vim.
+ * Go check out the [master repo]( for more info.
-![screen 1](
-![screen 2](
-![screen 3](
-![screen 4](
+This is an experimental repo for different storage backends.
-## Branches
+## .vimrc settings
-* `master` contains the released version of the plugin.
+The docs can be a bit terse and having **any** mappings in insert mode seems odd, particularly when the default mapping is ``\n`` for open a new pad. I hit that a lot so here are the mappings I use which only trigger in normal mode.
-* `devel` contains the development version of the plugin.
+ " vim-pad settings
+ let g:pad_dir = '/home/possiblywrong/.notes/'
+ let g:pad_use_default_mappings = 0
+ " vim-pad mappings
+ nmap <leader><esc> <Plug>ListPads
+ nmap <leader>n <Plug>OpenPad
+ nmap <leader>s <Plug>SearchPads
-Pull requests are to be done over `devel`. When submitting a bug, please tag
-the affected versions.
-## Configuration and Usage
-**IMPORTANT**: you must set the g:pad_dir variable to a valid path. It is
-recommended to use an empty folder for this.
-For the full documentation, please consult
- :help vim-pad
+Note that to get the list buffer to behave correctly you'll also need
+ filetype on
+ filetype plugin indent on
6 ftplugin/pad.vim
@@ -6,12 +6,14 @@ setlocal nowrap
setlocal nomodified
setlocal conceallevel=2
setlocal concealcursor=nc
+setlocal nocp
noremap <buffer> <silent> <enter> :call pad#EditPad()<cr>
-if has("gui_running")
+if has("gui_running") && g:pad_use_terminal_mappings != 1
noremap <buffer> <silent> <delete> :call pad#DeletePad()<cr>
+ noremap <buffer> <silent> <S-esc> :bw<cr>
noremap <buffer> <silent> dd :call pad#DeletePad()<cr>
+ noremap <buffer> <silent> <leader><esc> :bw<cr>
-noremap <buffer> <silent> <esc> :bw<cr>
noremap <buffer> <silent> <S-f> :call pad#IncrementalSearch()<cr>
noremap <buffer> <silent> <S-s> :call pad#Sort()<cr>
5 plugin/pad.vim
@@ -47,6 +47,9 @@ endif
if !exists('g:pad_use_default_mappings')
let g:pad_use_default_mappings = 1
+if !exists('g:pad_use_terminal_mappings')
+ let g:pad_use_terminal_mappings = 0
if !exists('g:pad_modeline_position')
let g:pad_modeline_position = 'bottom'
@@ -91,7 +94,7 @@ function s:CreateMapping(key, action, modename)
if g:pad_use_default_mappings == 1
- if has("gui_running")
+ if has("gui_running") && g:pad_use_terminal_mappings != 1
call s:CreateMapping("<C-esc>", "ListPads", "normal")
call s:CreateMapping("<C-esc>", "ListPads", "insert")
call s:CreateMapping("<S-esc>", "OpenPad", "normal")
13 plugin/padlib/
@@ -52,6 +52,17 @@ def open_pad(path=None, first_line=None): #{{{1
vim.command("normal! j")
+def isdotfile(fname=None):
+ """
+ Returns true if the file passed is a dotfile
+ NB: not windows safe, due to split. someone else
+ with a win box can fix it
+ """
+ if fname.startswith('.'):
+ return True
+ if fname.split("\\")[-1].startswith('.'):
+ return True
+ return False
def get_filelist(query=None): # {{{1
""" __get_filelist(query) -> list_of_notes
@@ -61,7 +72,7 @@ def get_filelist(query=None): # {{{1
or ack search for query in self.save_dir.
if not query or query == "":
- files = listdir(get_save_dir())
+ files = [ e for e in listdir(get_save_dir()) if not isdotfile(e) ]
search_backend = vim.eval("g:pad_search_backend")
if search_backend == "grep":
2  plugin/padlib/
@@ -24,6 +24,8 @@ def delete_pad(): #{{{1
+ else:
+ vim.command("redraw!")
def incremental_search(): #{{{1
""" Provides incremental search within the __pad__ buffer.

No commit comments for this range

Something went wrong with that request. Please try again.