Skip to content

LeonWandruschka/nvim-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Current NEOVIM config

Setup macOS

Install neovim:
brew install neovim

Install node:
brew install node

Install yarn:
pm install -g yarn

Install vim-plug:

sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'

Clone Repository into ~/.config/nvim:
git clone https://github.com/LeonWandruschka/nvim-config.git ~/.config/nvim/

Now open neovim and execute :PlugInstall

Exit vim and move to the nvim/plugged/coc folder:
cd ~/.local/share/nvim/plugged/coc.nvim/

In this folder execute yarn install

Now open neovim again:
nvim ~/.config/nvim/init.vim

After opening neovim execute :CocInstall coc-clangd and
right afterwards execute :CocCommand clangd.install

Setup Ubuntu

Update System

sudo apt update && sudo apt upgrade -y

Install Git and vim

sudo apt install git -y && sudo apt install vim -y

Install other dependencies

Nodejs

sudo apt install nodejs -y && sudo apt install npm -y && sudo npm install -g n
sudo n latest && sudo npm install -g npm-check-updates

Clangd | Python3 | exuberant-ctags

sudo apt install clangd -y && sudo apt install python3 -y && sudo apt install exuberant-ctags -y

Install latest neovim using snap

sudo snap install --beta nvim --classic

Install FONT

Set Terminal -> preferences to custom font and choose MelsoGS NF

Setup Console (optional)

Install zsh

sudo apt install zsh -y

Install ohmyzsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install Powerlevel10k (ohmyzsh configuration)

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Set the ZSH theme to powerlevel10k!

ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc

Close Terminal!

Now set a custom command in the terminal Preferences to call zsh

Reopen Terminal and follow powerlevel10k config.

Back to neovim

Install vimplug (packagemanager)

sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'

Clone current config

git clone https://github.com/LeonWandruschka/nvim-config.git ~/.config/nvim/

Open nvim and press ENTER on upcoming warnings!

Enter :PlugInstall and wait till all plugins are isntalled

Use two times after each other :q to quit neovim ;)

Goto: cd ~/.local/share/nvim/plugged/coc.nvim/ and use sudo npm ci to build (can take a while)

Now neovim is setup!

Additional programs that are nice: lazy git:

LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
  • PULL: p
  • PUSH: P
  • ADD: Move to file using h & l and press SPACE
  • Commit c

Keybindings and Useful Commands

Navigation

  • Up: k
  • Down: j
  • Left: h
  • Right: l
  • Move around in splits: Ctrl + w, < h | j | k | l >
  • Move splits around: Ctrl + w, Shift + < h | j | k | l >
  • Resize splits: Ctrl + w, < + | - | < | > >

Moving Around in Insert and Command Line Mode

  • Move Down: Ctrl + j
  • Move Up: Ctrl + k
  • Move Left: Ctrl + h
  • Move Right: Ctrl + l
  • Delete: Ctrl + d

Working with Splits

  • Move around in splits: Ctrl + w, < h | j | k | l >
  • Move splits around: Ctrl + w, Shift + < h | j | k | l >
  • Resize splits: Ctrl + w, < + | - | < | > >

Additional Commands

  • Open man page: :Man <function>
  • If GDB is installed, you can use:
    • :packadd termdebug
    • :Termdebug <gdb-arguments>
  • Open/close file tree: Ctrl + b (Updated: Toggle with NvimTreeToggle)
  • Set focus on file tree: Ctrl + f (Updated: Focus with NvimTreeFocus)
  • If Exuberant Ctags is installed:
    • Ctrl + t (Updated: Toggle with TagbarToggle)
  • Open terminal on the bottom: Alt + t (Updated: Toggle with a custom height of 5 lines)

Terminal Functionality

  • Toggle terminal: Alt + t (Enhanced to toggle on/off with custom height)
  • Exit terminal mode: Esc (For moving back to normal mode in terminal)
  • Force quit: :q! (Within terminal mode)

File and Tag Management

  • Toggle file tree: Ctrl + b (Updated to use NvimTreeToggle for both insert and normal modes)
  • Focus on file tree: Ctrl + f (Updated to use NvimTreeFocus for both insert and normal modes)
  • Toggle tag bar: Ctrl + t (Updated to use TagbarToggle for both insert and normal modes)

Search Files

  • Search files: Ctrl + p (Mapped to trigger :Files command)
  • Close without opening File: Ctrl + c

Clang Format

A clang-format configuration file is provided at ~/.config/nvim/.clang-format. This configuration file is used to format files in Neovim. You are welcome to modify this file according to your preferences or replace it with your own.

To specify a different clang-format configuration file, navigate to your init.vim file and locate section 13. You can update the file path within this section to point to your desired clang-format configuration file. By default, it points to ~/.config/nvim/.clang-format.

To format the currently opened file using clang-format, you can use the :Cf command. Simply execute :Cf within Neovim to apply the formatting.

Copy to Clipboard

Check if copy to clipboard is enabled on your system using the following: :echo has('clipboard') If this returns 1 copying stuff to the clipboard will be easy.

Just use :%y+ to copy the whole file or select the part you want to copy using the visual mode and then use :'<,'>y+

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published