sponsor Vim development Vim logo Vim Book Ad

bookmarks.vim : enhanced bookmarks

 script karma  Rating 2/2, Downloaded by 80  Comments, bugs, improvements  Vim wiki

created by
Javier Puigdevall
 
script type
utility
 
description
Abridged command help:                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                  
- Add bookmarks:                                                                                                                                                                                                                                                                  
    Bka [SEP] [COMMENTS] : add new mark to bookmarks session file (SEP: = - # _ . *).                                                                                                                                                                                            
    Bkai [OPT]           : add new mark and indent the text (OPT: ?/number/d/i/q/s/r).                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                  
- Remove bookmarks:                                                                                                                                                                                                                                                              
    Bkd                  : delete bookmark on cursor position.                                                                                                                                                                                                                    
    Bku                  : delete last saved bookmark.                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                  
- Manage bookmarks session:                                                                                                                                                                                                                                                      
    Bksh                 : show marks session file name.                                                                                                                                                                                                                          
    Bkl [FILE]           : load bookmarks session marks into quickfix.                                                                                                                                                                                                            
    BkU                  : unload bookmarks session file.                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                  
- Edit the saved bookmarks (only on bookmarks' file or quickfix window):                                                                                                                                                                                                          
    Bke                  : open marks session file on new tab.                                                                                                                                                                                                                    
    [range]Bkrv          : reverse the selected lines (last line on top, first line on bottom).                                                                                                                                                                                  
    [range]Bki [OPT]     : indent bookmarks file (OPT: ?/num/-/+/=).                                                                                                                                                                                                              
    [range]BkI [OPT]     : indent bookmarks file in reverse order (OPT: ?/num/d/i/q).                                                                                                                                                                                            
    [range]Bkirm         : remove indentation on bookmarks file.                                                                                                                                                                                                                  
    Bkin                 : show current bookmark line indentation level number.                                                                                                                                                                                                  
    BkiN                 : set current bookmark line indentation level number as the new indentation number.                                                                                                                                                                      
                                                                                                                                                                                                                                                                                  
- Settings (bookmarks' file settings):                                                                                                                                                                                                                                            
    Bkpl [LINE]          : position on line number. Set indentation number to the current line indentation.                                                                                                                                                                      
                     position on current line (and current indentation) when no line provided.                                                                                                                                                                              
    Bkm [MODE]           : change/show direction mode (f:fordwards, b:backwards).                                                                                                                                                                                                
                     toogle current mode when no argument found.                                                                                                                                                                                                            
                     show current mode when argument is ?.                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                  
- Yank/Paste commands:                                                                                                                                                                                                                                                            
    Bky                  : yank bookmark (file, position and line text) into system clipboard.                                                                                                                                                                                    
                     add the bookmark to the yank buffer too.                                                                                                                                                                                                              
    BkY                  : yank bookmark (file and position only) into system clipboard.                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                  
- Yank buffer commands:                                                                                                                                                                                                                                                          
    Bkym [MODE]          : set yank mode (insert/append).                                                                                                                                                                                                                        
                     toogle current mode when no argument found.                                                                                                                                                                                                            
                     show current mode when argument is ?.                                                                                                                                                                                                                  
    Bkp                  : paste all bookmarks previosly yanked.                                                                                                                                                                                                                  
    BkP                  : paste all bookmarks previosly yanked on previous line.                                                                                                                                                                                                
    Bky0                 : empty all bookmarks previosly yanked.                                                                                                                                                                                                                  
    Bkp0                 : empty all bookmarks previosly yanked.                                                                                                                                                                                                                  
    BkyR                 : recover all previous bookmarks on yank buffer.                                                                                                                                                                                                        
    Bkyr                 : reverse the order on all bookmarks on yank buffer.                                                                                                                                                                                                    
    Bkysh                : show main yank buffer.                                                                                                                                                                                                                                
    Bkyshp               : show previous yank buffer.                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                  
- Others:                                                                                                                                                                                                                                                                        
    Bkqf2f               : replace qf file format to save as bookmarks file.                                                                                                                                                                                                      
    Bkv LEVEL            : Change plugin verbose level.                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                  
Options hepl:                                                                                                                                                                                                                                                                    
    SEP: use separator characater. Characters allowed = - # _ . *                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                  
    OPT ?: show indentation configuration.                                                                                                                                                                                                                                        
    OPT number: add number to the current indentation and add bookmarks.                                                                                                                                                                                                          
    OPT d: decrease indentation and add bookmark indented.                                                                                                                                                                                                                        
    OPT =: keep previous indentation and add bookmark indented.                                                                                                                                                                                                                  
    OPT r: reset indentation number to 0 and add bookmark.                                                                                                                                                                                                                        
    OPT s: increase indentation number and add bookmark indented without indentation number (if active).  

----------------------------------------------------------------------------------------------------------------------------------              
                                                                                                                                                                                                                                                                                  
EXAMPLES:                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                  
:Bka                                                                                                                                                                                                                                                                              
  Add new bookmark on current position.                                                                                                                                                                                                                                          
  Result:                                                                                                                                                                                                                                                                        
  filepath:line:column:...... current line text                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                  
:Bka Comment text                                                                                                                                                                                                                                                                
  Add new bookmark with a previous comment line.                                                                                                                                                                                                                                  
  Result:                                                                                                                                                                                                                                                                        
  Comment text  filepath:line:column:...... current line text                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                  
:Bka == Title text with separator up and down                                                                                                                                                                                                                                    
  Add new bookmark with title and separators from current line.                                                                                                                                                                                                                  
  Result:                                                                                                                                                                                                                                                                        
  =========================================                                                                                                                                                                                                                                      
  Title text with separator up and down                                                                                                                                                                                                                                          
  =========================================                                                                                                                                                                                                                                      
  filepath:line:column:...... current line text                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                  
:Bka ## Title text with separator up and down                                                                                                                                                                                                                                    
  Add new bookmark with title and separators from current line.                                                                                                                                                                                                                  
  Result:                                                                                                                                                                                                                                                                        
  #########################################                                                                                                                                                                                                                                      
  Title text with separator up and down                                                                                                                                                                                                                                          
  #########################################                                                                                                                                                                                                                                      
  filepath:line:column:...... current line text                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                  
:Bka - Title text with one separator                                                                                                                                                                                                                                              
  Add new bookmark with title and separators from current line.                                                                                                                                                                                                                  
  Result:                                                                                                                                                                                                                                                                        
  -----------------------------------------                                                                                                                                                                                                                                      
  Title text with one separator                                                                                                                                                                                                                                                  
  filepath:line:column:...... current line text                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                  
:Bkai 3                                                                                                                                                                                                                                                                          
  Add new bookmark with indentation.                                                                                                                                                                                                                                              
  Result:                                                                                                                                                                                                                                                                        
  filepath:line:column:......    current line text 1                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                  
:Bkai                                                                                                                                                                                                                                                                            
  Add new bookmark and increase previous indentation (indentation will be 5 spaces).                                                                                                                                                                                              
  Result:                                                                                                                                                                                                                                                                        
  filepath:line:column:......    previous line text 1                                                                                                                                                                                                                            
  filepath:line:column:......     current line text                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                  
:Bkai q                                                                                                                                                                                                                                                                          
  Add new bookmark and keep previous indentation (indentation will be 5 spaces).                                                                                                                                                                                                  
  Result:                                                                                                                                                                                                                                                                        
  filepath:line:column:......    previous line text 1                                                                                                                                                                                                                            
  filepath:line:column:......     previous line text 2                                                                                                                                                                                                                            
  filepath:line:column:......     current line text                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                  
:Bkai d                                                                                                                                                                                                                                                                          
  Add new bookmark and decrease previous indentation (indentation will be 4 spaces).                                                                                                                                                                                              
  Result:                                                                                                                                                                                                                                                                        
  filepath:line:column:......    previous line text 1                                                                                                                                                                                                                            
  filepath:line:column:......     previous line text 2                                                                                                                                                                                                                            
  filepath:line:column:......     previous line text 3                                                                                                                                                                                                                            
  filepath:line:column:......    current line text                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                  
:Bkai r                                                                                                                                                                                                                                                                          
  Add new bookmark and decrease previous indentation (indentation will be 0 spaces).                                                                                                                                                                                              
  Result:                                                                                                                                                                                                                                                                        
  filepath:line:column:......    previous line text 1                                                                                                                                                                                                                            
  filepath:line:column:......     previous line text 2                                                                                                                                                                                                                            
  filepath:line:column:......     previous line text 3                                                                                                                                                                                                                            
  filepath:line:column:......    previous line text                                                                                                                                                                                                                              
  filepath:line:column:......current line text                                                                
 
install details
Minimum version: Vim 7.0+
Recomended version: Vim 8.0+

Binaries: ag (silver searcher) or grep needed to open the filter window.

Install vimball:
download bookmarks_1.0.0.vmb
vim bookmarks_1.0.0.vmb
:so %
:q
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
bookmarks_1.0.0.vmb 1.0.0 2021-06-02 7.0 Javier Puigdevall Initial upload
ip used for rating: 3.89.204.127

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
OSDN