Skip to content

rexagod/samwise.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

samwise.nvim

Introduction

samwise.mp4

samwise is a line-wise note-taking plugin for neovim that aims to provide a better note-taking enviroment by employing vim's concepts. It allows you to take notes in a different buffer (each samwise buffer is unique to its parent buffer) which is created automatically based on the current buffer's path and the current buffer's name.

If the current line in the buffer does not have a corresponding <EOL> character as the only content in the samwise buffer, the user is dropped to the corresponding line, and the samwise buffer scrolls sychronously with its parent buffer and vice versa. Users can make changes, or add new text entries for any line of the parent buffer in this manner and even commit those besides the parent buffer, as a "comment file" so as to not populate the parent buffer with extraneous comments and keep the codebase cleaner in general. This is just one of the many use cases where samwise can help.

It also allows highlighting hunks which correspond to the samwise buffer entries, navigating between them, and seeing those entries either in a floating window, or by echoing them.

To make it explicity clear, from this point on, a "samwise buffer" will mean the autogenerated buffer that stores all the line-wise notes corresponding to its companion buffer (or how I call it, it's Frodo).

Configuration

Globals

  • g:samwise_buffer_opts: Options for opening the samwise buffers. Defaults to: "bo " . winheight(0)/10 . "sp".
  • g:samwise_dir: Directory that stores all samwise buffers.
  • g:samwise_echo: Set to a truthy value to echo samwise buffers' corresponding contents.
  • g:samwise_float: Set to a truthy value to show samwise buffers' corresponding contents in a floating window.
  • g:samwise_floating_opts: Options for opening the samwise floating windows. Defaults to:
" Refer `nvim_open_win` for more details.
let g:samwise_floating_opts = {
                \ ...
                \ 'relative': 'cursor',
                \ 'focusable': v:false,
                \ 'style': 'minimal',
                \ 'border': 'shadow',
                \ 'noautocmd': v:true
                \ }
  • g:samwise_format: Extension that the samwise buffers should default to.

Commands

  • :SamwiseMoveBack: Move to the previous samwise hunk; suggested binding, [S.
  • :SamwiseMoveFwd: Move to the next samwise hunk; suggested binding, ]S.
  • :SamwiseToggleBuffer: Open or close the samwise buffer to add or review notes.
  • :SamwiseToggleHighlight: Highlight all lines in the current buffer that have corresponding non-empty lines in the samwise buffer.

License

BSD-2-Clause