Skip to content

nihguy/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dotfiles

This repository holds all my main configuration files. They meet all (or almost all) of my daily needs and I'm making them available in the hope that they can help others too, so feel free to suggest, modify and use it as needed.

Contents

(Neo)vim

File: init.vim

Installing (Neo)vim Plugins

All configuration requires vim-plug as plugin manager, so make sure to install it as soon as possible. After sucessfully installed, from Normal Mode, type :PlugInstall and wait for the instalation to complete.

External Dependencies

  • clangd: it's used for lint, format and a lot of features used through the configuration file
  • nodejs > 12.12: it's required by coc-nvim
  • vim-plug: a minimalist (Neo)vim plugin manager which install all required plugins

(Neo)vim Plugin List

Adding some features:

Name Description
neoclide/coc.nvim Make your editor as smart as VSCode (installing pluggins, adding features and shortcuts)
dense-analysis/ale Providing linting (syntax checking and semantic errors)
preservim/nerdtree A file system explorer for the editor
preservim/nerdcommenter Adding shortcuts for using the correct comment symbol in a long list of files with minimal effort

Adding some GUI improvements

Name Description
morhetz/gruvbox A beutiful retro groove color scheme
Yggdroot/indentLine Displaying the indention levels with thin vertical lines
vim-airline/vim-airline Adding a nice statusline at the bottom of each vim window
vim-highlight-cursor-words Highlighting words under cursor everywhere in the opened buffer
vim-arlines/vim-airline-themes A collection of themes for vim-airline

Custom Shortcuts

NORMAL MODE:

Shortcut Description
<leader>a Open a FUZZY window for searching and selecting diagnostics
[count]<leader>c<space> Toggles the comment state of the selected lines(s). If the topmost selected line is commented, all selected lines ate uncommented and vice versa
<leader>ca Switch to the alternative set of delimiters ("\" or "**" in C/C++)
<leader>cA Adds comment delimiters to the end of line and goes into insert mode between them
[count]<leader>ci Toggles the comment state of the selected lines(s) individually
[count]<leader>cs Comments out the selected lines with a pretty block formatted layout
[count]<leader>cy Same as cc except that the commentes line(s) are yanked first
[count]<leader>cm Toggles the given lines using only one set of multipart delimiters.
<leader>c$ Comments the current line from the cursor to the end of line
<leader>cu Uncomments the selected lines(s)
<leader>d Open a FUZZY window for seaching and selecting symbols
<leader>s Open a FUZZY window for seaching and selecting symbols
<leader>fg Open a window with the available fixes if there are any
<C-n> Toggle the NERDTree window
<leader>f Select a code block with visual mode and format it
<leader>rn Open a window which allow you to rename all occurrences of the symbol at once
<leader>rn Open a window with all occurrences of the same symbol through the files and change all them at once
gd Go to the symbol's definition
gr List the symbol's reference used in all opened files
K Open a preview window with the documentation's symbol
]g Navigate to the next diagnostic
[g Navigate to the previous diagnostic
<ESC> Pressing the key all hightlighs of searching are removed
<A-j> Move the entire line down
<A-k> Move the entire line up
<leader>t If the file under the cursor has a header or a source file, toggle between them using the current buffer.
<leader>| If the file under the cursor has a header or a source file, open the another one in a new vertical window, side by side.

VISUAL MODE:

Shortcut Description
if Map the function inner scope
af Map the function inner scope and its definition
ic Map the class inner scope
ac Map the class inner scope and its definition

Installing the Coc Extensions

Currently, the only required extension is coc-clangd. From Normal Mode, type the command :CocInstall coc-clangd to install it and make sure to configure the clangd language server.

Configuring the Coc Plugins

From Normal Mode, enter the Command Mode by running :CocConfig. Then, copy and paste the code bellow in the coc-setting.json file which will be opened.

{
    "clang.enabled": true
}

Clang-Format

File: .clang-format

The current (Neo)vim configuration is able to format your code automatically, always you save a file, but it will follow the default clang-format rules. It's possible to change the default style guide overriding it with a file called .clang-format. Just ensure to put it on the root directory of your project (to change only this project) or on the parent directory to make it available for all child directories.

External Dependencies

  • clang-format > 13.0.1: There is a lot of ways to install clang-format (using pip, npm, package manager, and so on). Choose the better solution for you.

How to Change the Style Guide

The current style guide is focusing on data and not on the language syntax. If you don't like that, you can change the style rules just by modifying the .clang-format file. Take a look at documentation for more information.

About

All dotfiles that meet my daily needs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published