Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rational.nvim

My collection of sensible Neovim default settings.

All options are organized into sections with comments for clarity.

Features

Default Settings

  • Mouse support enabled (mouse = 'a')
  • Swap files disabled
  • Scroll margins: 5 lines vertical, 15 lines horizontal
  • Split windows below and to the right
  • Completion menu configuration (always show, no auto-select)
  • Long lines not wrapped (wrap = false), wrapping at word boundaries when enabled
  • Max text width of 120 characters
  • Spaces for indentation (2 spaces)
  • Visible whitespace characters (tabs, trailing spaces, line endings)
  • Cursor line highlighting
  • Line numbers displayed, relative to the cursor
  • True colors enabled (termguicolors)
  • Status line always visible
  • Smart case search (case-insensitive unless uppercase letters are used)
  • System clipboard integration (clipboard = 'unnamedplus')
  • Minimal diagnostics UI (gutter signs + underlines, no inline text)
  • Automatic trailing whitespace trimming on save
  • Terminal buffers entered in insert mode

Key Bindings

  • / - Enable search highlighting when searching
  • <leader><cr> - Clear search highlighting
  • <S-Tab> (Insert mode) - Tab backwards
  • j/k - Move by display lines (works with wrapped text)
  • va - Select all text
  • </> (Visual mode) - Indent and keep selection
  • D - Delete to end of line (consistent with C)
  • Y - Yank to end of line (consistent with D and C)

Commands

  • :BufOnly / :bo - Close all buffers except the current one
  • :PackUpdate [name...] - Update all plugins installed with vim.pack, or only the named ones (tab-completes plugin names)
  • :PackOrphans - List plugins still on disk after their source was removed from the config
  • :PackClean - Delete those orphans, after confirming

The :Pack* commands are only defined on Neovim 0.12+, where vim.pack exists.

Functions

The module returns helpers for you to bind yourself:

  • require('rational').copy_path(absolute, ranged) - Copy the current buffer's path to the clipboard. absolute picks %:p over %; ranged appends the selected line range (e.g. init.lua:10-20) and is meant for a visual-mode mapping:
vim.keymap.set('x', '<leader>p', function() require('rational').copy_path(false, true) end)

Configuration

You can customize the plugin behavior by setting global variables in your init.lua:

  • vim.g.rational_diagnostic_signs (boolean, default: true) - Enable custom LSP diagnostic signs (requires nerd font icons)

Installation

Using vim-plug:

Plug 'lcmen/rational.nvim'

About

My collection of sensible Neovim default settings.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Used by

Contributors

Languages