Skip to content

koseiohara/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

148 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Non-Intrusive Neovim-Config

This environment depends on various plugins, including a plugin manager.
Simply clone this repository into $HOME/.config/ after neovim is built.
All files in this repository cannot be used with vim.
To fully use tools in this repository, install lazygit for lazygit, ripgrep for telescope, tree-sitter-cli for treesitter, macism (only on macOS) for better InsertLeave experience, latexmk for vimtex, a suitable PDF viewer depending on your OS for vimtex, and dictionary and deno for skkeleton.

This Neovim setup focuses on manual editing efficiency. It may not suit those who rely on completion or automation, as these features are intentionally disabled.

Key Bindings

Key bindings are written in nvim/lua/config/keymap.lua.
Both <leader> and <localleader> are set as <space>. They can be reset in init.lua by yourself.

Normal Mode

Key Action Description
gh ^ move to first non-blank character in the line
gl $ move to the end of line
gk gg move to the first line
gj G move to the last line
<S-h> 10h move left 10 columns
<S-l> 10l move right 10 columns
<S-k> 10k move up 10 lines
<S-j> 10j move down 10 lines
<leader>b % move to bracket
x "_x delete a character without yanking
s "_s delete a character and enter insert mode without yanking
; : enter command mode
<leader>q q: command-line window
q: <Nop> (this command was removed)
<leader>n :set relativenumber!<CR> switch linenumber <-> relativenumber
<Tab> :tabnext<CR> move to the next tab (This command is overridden in barbar.nvim's setting)
<S-Tab> :tabprevious<CR> move to the previous tab (This command is overridden in barbar.nvim's setting)
<C-h> <C-w>h move to the left window
<C-l> <C-w>l move to the right window
<C-k> <C-w>k move to the upper window
<C-j> <C-w>j move to the lower window
<leader>wt :tabnew open a new tab
<leader>wv :vsplit open a file in a new vertical split
<leader>wh :split open a file in a new horizontal split
<leader><BS> :close<CR> close the current file
<right> <Nop> (this command was removed)
<left> <Nop> (this command was removed)
<down> <Nop> (this command was removed)
<up> <Nop> (this command was removed)
<S-right> <C-w>< decrease window width
<S-left> <C-w>> increase window width
<S-down> <C-w>- decrease window height
<S-up> <C-w>+ increase window height

Insert Mode

Key Action Description
kj/Kj/KJ <Esc> return to normal mode
<right> <Nop> (this command was removed)
<left> <Nop> (this command was removed)
<down> <Nop> (this command was removed)
<up> <Nop> (this command was removed)

Visual Mode

Key Action Description
< <gv decrease indent
> >gv increase indent

Commands

Command Description
:rpl replace all highlighted matches with a new word

Abbreviations

Abbreviation File Type Inserted Text
;;r fortran real
;;i fortran integer
;;l fortran logical
;;c fortran character

Plugins

In this toolkit, lazy.nvim is used as the package manager. It will automatically install all plugins listed below. Plugin list can be displayed with command :Lazy.
In this document, descriptions of key bindings that are the same as the plugin defaults are omitted.

Some icons may not render correctly in certain terminal emulators, including Terminal.app on macOS.

Key Action Description
:sk :ShowkeysToggle<CR> show entered keys
Key Action Description
<Tab> :BufferNext<CR> move to the next tab
<S-Tab> :BufferPrevious<CR> move to the previous tab
:bc :BufferClose<CR> close the current buffer

ltex, texlab, fortls, pylsp, and lua_ls will be installed.

This repository comes with the following Language Server Protocol (LSP) servers installed: ltex, texlab, fortls, pylsp, and lua_ls. They will provide highlighting, virtual text annotations, and signs in the statuscolumn for syntax errors. Hovers, auto-completion, and code-action are intentionally disabled to avoid disrupting focus. If certain English words are incorrectly flagged as spelling mistakes by ltex, add them to $HOME/.config/ltex/dictionary.en-US.txt.

Key Mode Action Description
gs Normal, Operator-pending, Visual jump jump to the selected label
gS Normal, Operator-pending, Visual treesitter jump to the selected label in treesitter mode
r Operator-pending remote perform an operator at a remote location
R Operator-pending treesitter_search perform an operator at a remote location in treesitter mode
<C-s> Command toggle show and enable labels to jump to
Key Action Description
<C-h> <Nop> (this command was removed)
<C-l> <Nop> (this command was removed)
<BS> 'actions.parent' move to parent directory
<C-CR> 'actions.select_tab' open selected file/directory in a new tab
<CR> open selected file in a new tab, or move to the directory if a directory is selected
<leader>e open/close oil window

Descriptions follow these of official GitHub repository.

Key Description
<leader>ff lists files in your current working directory
<leader>fg search for a string in your current working directory and get results live as you type
<leader>fG searches for the string under your cursor or selection in your current working directory
<leader>fb lists open buffers in current neovim instance
<leader>fh lists available help tags and opens a new window with the relevant help info on <CR>
<leader>gc lists git commits with diff preview
<leader>gs lists current changes per file with diff preview and add action
<CR> in telescope window: open the selected file in a new tab
<S-k> in telescope window: move up 5 lines
<S-j> in telescope window: move down 5 lines

<leader>fg command needs ripgrep.

Key Description
<leader>tt open terminal in a new window
<leader>tv open terminal in a new vertical split
<leader>th open terminal in a new horizontal split
<leader>tf open terminal in a float window

Key bindings

Key Description
<leader>gg open lazygit in a new float split
Key Description
<localleader>md show a markdown viewer
<localleader>ms show a markdown viewer in a vertical split

To edit latex source code using vimtex, install Skim on macOS, SumatraPDF on Windows, and Zathura on Linux. Also, latexmk is needed to compile source codes.

Key Description
<localleader>ll compile source. if .latexmkrc is not in the same directory as the main file, it will be generated automatically
<localleader>le open/close error window

The automatically generated .latexmkrc is a copy of tools/.latexmkrc. To change the compile method, edit the original tools/.latexmkrc.

NOTE

  • VimTex's settings have not been tested on Windows and Linux.

Available only when the file type is tex, markdown, txt, or html. Install deno via any package manager and clone dictionary in $HOME/.config/. Execute a command below to save a user dictionary:

$ mkdir -p $HOME/.config/skkeleton
Key Mode Description
<C-j> Insert Enable skkeleton
<C-k> Insert Disable skkeleton
<C-l> Insert return to normal mode

New dials:

  • 3-digit months (Jan - Feb - Mar - ... - Dec)
  • begin/end (begin - end)
  • Inequality signs (< - >, <= - >=)
  • Arithmetic operators (+ - -)
  • Fortran logical (.True. - .False.)
  • Fortran intent attribute (out - in - inout)

About

Neovim Setting Collection

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors