Skip to content

Base configuration for nvim using vimscript and plugins

License

Notifications You must be signed in to change notification settings

IlReSenzaNome/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get Started

⚙️ Basic configuration for programming microcontrollers that can be used in mechatronic engineering.

Plugins leader key Plugin Management

Editor Style

Table of contents

⚡️ Requirements

  • Neovim >= 0.7
  • a Nerd Font(v3.0 or greater) (optional, but needed to display some icons)
  • Node >= 19.8.8
  • A C compiler in your path and libstdc++ installed (Windows users please read this!).
  • Properly configured Neovim LSP client
  • Python 3.11

🛠️ Installation

You can start with the configuration as follows:

Windows Install configuration with Poweshell
  1. In the terminal,

    git clone https://github.com/IlReSenzaNome/nvim.git $env:LOCALAPPDATA\nvim
    
  2. Reload the terminal and launch nvim,

    nvim $env:LOCALAPPDATA\nvim\init.vim
    
  3. Use the following command in nvim :PlugInstall,

  4. Install additional dependencies for configuration,

    Dependencies
     pip install -r requirements.txt
    

    On linux and macOs, you can install the fd-find package:

    npm install -g fd-find
    

    On windows using dependencies, you ca install the ripgrep

    winget install BurntSushi.ripgrep.MSVC
    
Linux/MacOS
  1. In the terminal,

    git clone https://github.com/IlReSenzaNome/nvim.git ~/.config/nvim
    
  2. Reload the terminal and launch nvim,

    nvim ~/.config/nvim/init.vim
    
  3. Use the following command in nvim :PlugInstall,

  4. Install additional dependencies for configuration,

    Dependencies
     pip install -r requirements.txt
    

    On linux and macOs, you can install the fd-find package:

    npm install -g fd-find
    

    On windows using dependencies, you ca install the ripgrep In Linux

    sudo apt-get install ripgrep
    

    In MacOS

    brew install ripgrep
    

⌨️ Keymaps

This setup uses several key combinations to make the job of using the extensions as easy as possible.

  • default is ,
  • default is \

General

Key Description Mode
<C-H> Go back in insert mode i
<C-J> Go down in insert mode i
<C-K> Go up in insert mode i
<C-L> Go forward in insert mode i

NerdTree

key Description Mode
<F2> Open the NerdTreeFind i,n,v
<F3> Close the NerdTreeToggle i,n,v

FloatTerm

Key Description Mode
<C-T> Create a new FloatTerm i,n,v
<C-A> Preview a FloatTerm i,n,v
<C-Q> Next FlatTerm i,n,v
<C-W> Toggle FloatTerm i,n,v

NerdComment

key Description Mode
<C-C> create a NerdCommentToggle i,n,v

Telescope

key Description Mode
<leader>ff Telescope find files i,n,v
<leader>fg Telescope live grep i,n,v
<leader>fb Telescope buffers i,n,v
<leader>fh Telescope help tags i,n,v

⚙️ Configuration

📂 File Structure

You can add your custom plugin specs under nvim/plugged/. All files there will be automatically loaded by vim-plug. For more information, see configuring plugins.

Files Structure

Colorscheme

set background=dark
colorscheme tokyonight
colorscheme tokyonight-night

Default settings

inoremap <C-H> <left>
inoremap <C-J> <down>
inoremap <C-K> <up>
inoremap <C-L> <right>
" Theme configuration
set background=dark
colorscheme tokyonight
colorscheme tokyonight-night
" Lsp
lua << END
require'lspconfig'.pyright.setup{"pyright-langserver", "--stdio"}
require'lspconfig'.ccls.setup{"ccls"}
END

" configuration nerdtree
let NERDTreeQuitOnOpen=1
nnoremap <silent> <F2> :NERDTreeFind<CR>
nnoremap <silent> <F3> :NERDTreeToggle<CR>

" Configuration floaterm example
let g:floaterm_keymap_new    = '<C-T>'
let g:floaterm_keymap_prev   = '<C-A>'
let g:floaterm_keymap_next   = '<C-Q>'
let g:floaterm_keymap_toggle = '<C-W>'

" NerdComments
nnoremap <C-C> <plug>NERDCommenterToggle

" Telescope
" Find files using Telescope command-line sugar.
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>

" Config lualine
lua << END
-- blankline
require("indent_blankline").setup {
    -- for example, context is off by default, use this to turn it on
    space_char_blankline = " ",
    show_current_context = true,
    show_current_context_start = true,
}
-- bufferline
require("bufferline").setup{}
-- trouble settings
require("trouble").setup()
local actions = require("telescope.actions")
local trouble = require("trouble.providers.telescope")

local telescope = require("telescope")

telescope.setup {
  defaults = {
    mappings = {
      i = { ["<c-t>"] = trouble.open_with_trouble },
      n = { ["<c-t>"] = trouble.open_with_trouble },
    },
  },
}

require("lualine").setup {
  options = {
    theme = "tokyonight",
    icons_enabled = true,
  },
  sections = {
    lualine_a = { "mode" },
    lualine_b = { "filename" },
    lualine_c = { "g:coc_status" },
    lualine_x = { "branch" },
    lualine_y = { "encoding" },
    lualine_z = { "location" }
  },
}
END

📦 Plugins List

About

Base configuration for nvim using vimscript and plugins

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published