Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made tabstopp and shiftwidth configurable #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Contents ~
13. The |g:notes_indexscript| option
14. The |g:notes_tagsindex| option
15. The |g:notes_markdown_program| option
16. The |g:notes_shoftwidth| option
4. Commands |notes-commands|
1. The |:Note| command
2. The |:NoteFromSelectedText| command
Expand Down Expand Up @@ -330,6 +331,13 @@ name of this program is assumed to be simply 'markdown'. If you want to use a
different program for Markdown to HTML conversion, set this option to the name
of the program.

-------------------------------------------------------------------------------
The |g:notes_shoftwidth| option

This option lets you choose the indent for lists within nodes. The shiftwidth
and the tabstop will be set to this value, By degault the value is set to 3.


===============================================================================
*notes-commands*
Commands ~
Expand Down
8 changes: 5 additions & 3 deletions ftplugin/notes.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

if exists('b:did_ftplugin')
finish
else
let b:did_ftplugin = 1
endif

if !exists('g:notes_tabwidth')
let g:notes_tabwidth = 8
endif

" Add dash to keyword characters so it can be used in tags. {{{1
Expand All @@ -18,7 +20,7 @@ setlocal autoindent
let b:undo_ftplugin = 'set autoindent<'

" Set &tabstop and &shiftwidth options for bulleted lists. {{{1
setlocal tabstop=3 shiftwidth=3 expandtab
execute "setlocal tabstop=".g:notes_tabwidth." shiftwidth=".g:notes_tabwidth." expandtab"
let b:undo_ftplugin .= ' | set tabstop< shiftwidth< expandtab<'

" Automatic formatting for bulleted lists. {{{1
Expand Down