From 4e5bb86065a504b11068d55de0d3c4f26ff63466 Mon Sep 17 00:00:00 2001 From: baabelfish Date: Thu, 3 Mar 2016 22:54:50 +0200 Subject: [PATCH] Better documentation - Closes #18 - Closes #17 - Closes #16 --- doc/nim.txt | 260 +++++++++++++++++++++++++++++++++++++++++------ ftplugin/nim.vim | 5 +- plugin/nim.vim | 2 - 3 files changed, 233 insertions(+), 34 deletions(-) diff --git a/doc/nim.txt b/doc/nim.txt index 243cd57..555856d 100644 --- a/doc/nim.txt +++ b/doc/nim.txt @@ -7,12 +7,28 @@ CONTENTS *nim-contents* 1.Introduction..........................................|NimIntro| 2.Features..............................................|NimFeatures| 2.1.Syntax highlighting.............................|NimSyntaxHL| - 2.2.Nimsuggest interaction..........................|NimSuggest| - 2.1.Get symbol information......................|NimSInfo| - 2.2.Goto symbol.................................|NimSGoto| - 2.3.Find usages.................................|NimSUsages| - 2.4.Refactoring.................................|NimSRefactoring| - 2.5.Outline (symbols in a module)...............|NimSOutline| + 2.2.Commands........................................|NimCommands| + 2.2.1.NimDebug..................................|NimDebug| + 2.2.2.NimDefinition.............................|NimDefinition| + 2.2.3.NimEdb....................................|NimEdb| + 2.2.4.NimEdbContinue............................|NimEdbContinue| + 2.2.5.NimEdbIgonore.............................|NimEdbIgonore| + 2.2.6.NimEdbSkipCurrent.........................|NimEdbSkipCurrent| + 2.2.7.NimEdbStepInto............................|NimEdbStepInto| + 2.2.8.NimEdbStepOver............................|NimEdbStepOver| + 2.2.9.NimEdbStop................................|NimEdbStop| + 2.2.10.NimEdbToggleBP...........................|NimEdbToggleBP| + 2.2.11.NimInfo..................................|NimInfo| + 2.2.12.NimOutline...............................|NimOutline| + 2.2.13.NimOutlineUpdate.........................|NimOutlineUpdate| + 2.2.14.NimREPL..................................|NimREPL| + 2.2.15.NimREPLEval..............................|NimREPLEval| + 2.2.16.NimREPLEvalFile..........................|NimREPLEvalFile| + 2.2.17.NimRenameSymbol..........................|NimRenameSymbol| + 2.2.18.NimRenameSymbolProject...................|NimRenameSymbolProject| + 2.2.19.NimUsages................................|NimUsages| + 2.2.20.NimUsagesProject.........................|NimUsagesProject| + 2.2.21.NimWeb...................................|NimWeb| 3.Options...............................................|NimOptions| 3.1.Option summary..................................|NimOptionSummary| 3.2.Option details..................................|NimOptionDetails| @@ -63,7 +79,7 @@ When you declare your on proc it gives you the highlight information for every usage of that proc. When your routine call fails, your syntax highlighting will fail too. -2.1.2Semantic highlighting *NimSyntaxHLI* +2.1.2.Semantic highlighting *NimSyntaxHLI* With the nimsuggest highlihgting it is possible to distinguish between different symbol types. You can specify which symbol kinds you want to @@ -81,42 +97,228 @@ with their own. ------------------------------------------------------------------------------ -2.2.Nimsuggest interaction *NimSuggest* +2.2.Commands *NimCommands* -Nimsuggest is a tool replacing the original nim idetools. This plugin -aims to use information given from nimsuggest to the fullest. +2.2.1.NimDebug *NimDebug* +Lists debug information + +2.2.2.NimDefinition *NimDefinition* +Jumps to the definition of symbol under the cursor. Uses nimsuggest def. + +2.2.3.NimEdb (experimental) *NimEdb* ------------------------------------------------------------------------------- -2.1.Get symbol information *NimSInfo* +2.2.4.NimEdbContinue (experimental) *NimEdbContinue* + +2.2.5.NimEdbIgonore (experimental) *NimEdbIgonore* + +2.2.6.NimEdbSkipCurrent (experimental) *NimEdbSkipCurrent* + +2.2.7.NimEdbStepInto (experimental) *NimEdbStepInto* + +2.2.8.NimEdbStepOver (experimental) *NimEdbStepOver* + +2.2.9.NimEdbStop (experimental) *NimEdbStop* + +2.2.10.NimEdbToggleBP (experimental) *NimEdbToggleBP* + +2.2.11.NimInfo *NimInfo* +Shows info about the symbol under cursor + +2.2.12.NimOutline *NimOutline* +Shows outline bar + +2.2.13.NimOutlineUpdate *NimOutlineUpdate* +Updates the content of the outline bar + +2.2.14.NimREPL (experimental) *NimREPL* +Opens a nim repl inside terminal. + +2.2.15.NimREPLEval (experimental) *NimREPLEval* +Evals current selection in the terminal. + +2.2.16.NimREPLEvalFile (experimental) *NimREPLEvalFile* +Evals the current file in the terminal. + +2.2.17.NimRenameSymbol *NimRenameSymbol* +Renames symbol under the cursor in the current module. + +2.2.18.NimRenameSymbolProject (experimental) *NimRenameSymbolProject* +Renames the symbol in all modules visible to main module. + +2.2.19.NimUsages *NimUsages* +List usages of symbol under cursor in the current module. + +2.2.20.NimUsagesProject *NimUsagesProject* +List usages of symbol under cursor in all modules visible from main module. + +2.2.21.NimWeb (experimental) *NimWeb* +Open documentation of the current word in browser (works with modules and symbols) - ------------------------------------------------------------------------------- -2.2.Goto symbol *NimSGoto* - ------------------------------------------------------------------------------- -2.3.Find usages *NimSUsages* - ------------------------------------------------------------------------------- -2.4.Refactoring *NimSRefactoring* - ------------------------------------------------------------------------------- -2.5.Outline (symbols in a module) *NimSOutline* - ============================================================================== 3.Options *NimOptions* ------------------------------------------------------------------------------- -3.1.Option summary *NimOptionSummary* +-------------------------------------------------------------------------------- + *g:nvim_nim_enable_async* + + let g:nvim_nim_enable_async = has("nvim") + +Allow usage of neovim jobcontrol. + +-------------------------------------------------------------------------------- + *g:nvim_nim_exec_nim* + + let g:nvim_nim_exec_nim = CheckDependency("nim") + +Location of nim executable. + +-------------------------------------------------------------------------------- + *g:nvim_nim_exec_nimble* + + let g:nvim_nim_exec_nimble = CheckDependency("nimble") + +Location of nimble executable. + +-------------------------------------------------------------------------------- + *g:nvim_nim_exec_nimsuggest* + + let g:nvim_nim_exec_nimsuggest = CheckDependency("nimsuggest") + +Location of nimsuggest executable. + +-------------------------------------------------------------------------------- + *g:nvim_nim_exec_bash* + + let g:nvim_nim_exec_bash = CheckDependency("bash") + +Location of bash executable. + +-------------------------------------------------------------------------------- + *g:nvim_nim_deps_nim* + + let g:nvim_nim_deps_nim = FindNimModulesPath() + +Location of nim modules. + +-------------------------------------------------------------------------------- + *g:nvim_nim_deps_nimble* + + let g:nvim_nim_deps_nimble = FindNimbleModulesPath() + +Location of nimble modules. + +-------------------------------------------------------------------------------- + *g:nvim_nim_outline_track_symbol* + + let g:nvim_nim_outline_track_symbol = 1 + +Automatic tracking of active symbol in outline buffer. + +- Experimental - + +-------------------------------------------------------------------------------- + *g:nvim_nim_highlighter_enable* + + let g:nvim_nim_highlighter_enable = 0 + +Use nimsuggest based highlighting. + +- Experimental - + +-------------------------------------------------------------------------------- + *g:nvim_nim_highlight_builtin* + + let g:nvim_nim_highlight_builtin = 1 + +Highlight builtin words. + +-------------------------------------------------------------------------------- + *g:nvim_nim_outline_buffer_width* + + let g:nvim_nim_outline_buffer_width = 30 + +Width of the outline buffer. + +-------------------------------------------------------------------------------- + *g:nvim_nim_repl_height* + + let g:nvim_nim_repl_height = 14 + +Height of the REPL terminal. + +-------------------------------------------------------------------------------- + *g:nvim_nim_repl_vsplit* + + let g:nvim_nim_repl_vsplit = 0 + +Split orientation of the repl. + +- Experimental - + +-------------------------------------------------------------------------------- + *g:nvim_nim_enable_default_binds* + + let g:nvim_nim_enable_default_binds = 1 + +Enable default command bindings. + +-------------------------------------------------------------------------------- + *g:nvim_nim_enable_custom_textobjects* + + let g:nvim_nim_enable_custom_textobjects = 1 + +Enable custom text objects (like routines with vif). + +-------------------------------------------------------------------------------- + *g:nvim_nim_highlighter_semantics* + + let g:nvim_nim_highlighter_semantics = [] + +Use semantic highlighting of specified symbols. Highlighting groups from +Semantic[0-19] are used to do the highlighter. Nimsuggest based highlighting +should be enabled for this to work. + +Available values: + skConst + skForVar + skGlobalLet + skGlobalVar + skLet + skModule + skParam + skTemp + skVar + +Example: let g:nvim_nim_highlighter_semantics = ["skConst", "skForVar"] + +- Experimental - + ------------------------------------------------------------------------------- -3.2.Option details *NimOptionDetails* ============================================================================== 4.Nim Keymappings *NimKeymappings* +Default mappings (disable with |g:nvim_nim_enable_default_binds|): + + nnoremap :NimDefinition + nnoremap gf :call util#goto_file() + nnoremap gd :NimDefinition + nnoremap gt :NimInfo + nnoremap gT :NimWeb + nnoremap cr :NimRenameSymbol + nnoremap cR :NimRenameSymbolProject + + +Custom text objects (disable with |g:nvim_nim_enable_custom_textobjects|): + + onoremap af :call util#SelectNimProc(0) + onoremap if :call util#SelectNimProc(1) + vnoremap af :call util#SelectNimProc(0)gv + vnoremap if :call util#SelectNimProc(1)gv + + ============================================================================== 5.About *NimAbout* diff --git a/ftplugin/nim.vim b/ftplugin/nim.vim index ca45d2a..0b1f374 100644 --- a/ftplugin/nim.vim +++ b/ftplugin/nim.vim @@ -39,7 +39,7 @@ command! -buffer -nargs=* -complete=buffer NimREPL :call features command! -buffer -nargs=* -complete=buffer NimREPLEvalFile :call features#repl#send(getline(0, line("$"))) command! -buffer -nargs=* -complete=buffer -range NimREPLEval :call features#repl#send(getline(getpos("'<")[1], getpos("'>")[1])) -if exists('g:nvim_nim_enable_default_binds') +if g:nvim_nim_enable_default_binds == 1 nnoremap :NimDefinition nnoremap gf :call util#goto_file() nnoremap gd :NimDefinition @@ -49,7 +49,7 @@ if exists('g:nvim_nim_enable_default_binds') nnoremap cR :NimRenameSymbolProject endif -if exists('g:nvim_nim_enable_custom_textobjects') +if g:nvim_nim_enable_custom_textobjects == 1 onoremap af :call util#SelectNimProc(0) onoremap if :call util#SelectNimProc(1) vnoremap af :call util#SelectNimProc(0)gv @@ -61,7 +61,6 @@ augroup nvim_nim_highlighter augroup END augroup nvim_nim_outline - " autocmd! CursorHold,BufWritePost,FileWritePost *.nim call features#outline#run(1) autocmd! FileWritePost *.nim call features#outline#run(1) autocmd! VimResized,WinEnter * call features#outline#render() augroup END diff --git a/plugin/nim.vim b/plugin/nim.vim index 0db2229..d7451cd 100644 --- a/plugin/nim.vim +++ b/plugin/nim.vim @@ -44,9 +44,7 @@ let g:nvim_nim_deps_nimble = FindNimbleModulesPath() let g:nvim_nim_outline_track_symbol = 1 let g:nvim_nim_highlighter_enable = 0 -let g:nvim_nim_enable_async = 1 let g:nvim_nim_highlight_builtin = 1 -let g:nvim_nim_highlight_use_unite = 0 let g:nvim_nim_outline_buffer = 1 let g:nvim_nim_outline_buffer_width = 30