Skip to content

expensne/nvim-settings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim

Location: ~/.config/nvim

Setup:

  1. Install nvim
  2. Install a plugin manager: packer (https://github.com/wbthomason/packer.nvim):
    git clone --depth 1 https://github.com/wbthomason/packer.nvim\
    ~/.local/share/nvim/site/pack/packer/start/packer.nvim
    
    nvim ~/.config/nvim/lua/expensne/packer.lua
    :so
    :PackerSync
    

Keymaps


VIM KEYBOARD SHORTCUTS

# vim: movement

H           - Move cursor to header (top) line of current visible window
M           - Move cursor to middle line of current visible window
L           - Move cursor to last line of current visible window

m           - Move up by half a page (remapped)
,           - Move down by half a page (remapped)

%           - Move cursor to next brace, bracket or comment paired to the current cursor location
*           - Search forward for word under cursor

# vim: marking

ma          - Set a marker a at cursor position to come back to later
´a          - Move cursor to exact position of the marker you set with ma (remapped)
ßa          - Move cursor to the first character of the line marked with ma (remapped)

# vim: misc

u           - Undo
U           - Undo all changes on current line
.           - Redo
:gg=G       - Fix indentation of whole file

# vim: window management

CTRL+w v    - Split current window vertically
CTRL+w c    - Close current window
CTRL+w m    - Move to window according to motion m

#split screen vertical
:vs filename
or
:vsplit filename
vim -O file1 file2

# packer

:so         - Source (shout out)
:PackerSync - Install / update packages

# remaps

:y          - Yank to system clipboard (same as y)
:yy         - Yank to system clipboard (same as yy)
:yg_        - Yank to system clipboard (same as yg_)
:p          - Paste from system clipboard (same as p)
:P          - Paste from system clipboard (same as P)
:f          - Format file

# telescope

:pf         -   Search project files (project file)
CTRL+p      -   Search git files
:ps         -   Search string (project string)

# undotree

:u          - Toggle undotree

# tree

:pv         - Open and focus project explorer (project view)
g?          - Shows keymaps

q           - Close
c           - Copy
a           - Create
x           - Cut
o           - Edit
p           - Paste
d           - Remove
r           - Rename
R           - Refresh
s           - System open
Tab         - Preview
CTRL-x      - Split
CTRL-t      - Tabnew

# lsp-zero

:Mason      - Opens mason to install language servers (install via 'i')

gd          - Goto definition
K           - Show docs
CTRL-h      - Signature help
:vws        - Search for symbol in workspace (vim workspace)
:vd         - ?
:vca        - Code action (viusal code action)
:vrr        - ? (vim references)
:vrn        - ? (vim rename)
+d          - Goto next diagnostic
#d          - Goto prev diagnostic

todo: https://github.com/neovim/nvim-lspconfig#suggested-configuration

# trouble

:xx         - Toggle trouble
:xq         - Toggle trouble quickfix

# fugitive

todo: configure

# lua

:lua applycs()  - Apply color sheme

Sources


Main source and tutorial:

neovim


brew install neovim

Plugins


packer.nvim - plugin/package management

telescope.nvim - fuzzy finder

tokyonight.nvim - theme

nvim-treesitter parser generator tool

undotree - undo history / browser

nvim-tree - file explorer

(key mapping)

lsp-zero.nvim - autocomplete

trouble.nvim - list for showing diagnostics, references, telescope results, quickfix and location lists

vim-fugitive - git integration

lualine.nvim - statusline

Optional

Add this to your ~/.config/nvim/init.vim to copy and paste to and from neovim and other apps:

set clipboard=unnamed

TODO

working with multiple files e.g. harpoon -- Using + number (1, 2, ... 9) to switch tab for i=1,9,1 do map('n', ''..i, i.."gt", {}) end map('n', '0', ":tablast", {})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages