Skip to content

Instantly share code, notes, and snippets.

@anvbis
Last active June 16, 2023 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anvbis/57cabd341e84a93c070f03e00b1a47c1 to your computer and use it in GitHub Desktop.
Save anvbis/57cabd341e84a93c070f03e00b1a47c1 to your computer and use it in GitHub Desktop.
init.vim
filetype plugin indent on
set tabstop=2
set shiftwidth=2
set expandtab
set number
set termguicolors
" https://github.com/junegunn/vim-plug
call plug#begin()
" https://github.com/nvim-tree/nvim-web-devicons
Plug 'nvim-tree/nvim-web-devicons'
" https://github.com/nvim-lua/plenary.nvim
Plug 'nvim-lua/plenary.nvim'
" https://github.com/nvim-telescope/telescope.nvim
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.1' }
" https://github.com/nvim-telescope/telescope-file-browser.nvim
Plug 'nvim-telescope/telescope-file-browser.nvim'
" https://github.com/neovim/nvim-lspconfig
Plug 'neovim/nvim-lspconfig'
" https://github.com/nvim-treesitter/nvim-treesitter
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
" https://github.com/sindrets/diffview.nvim
Plug 'sindrets/diffview.nvim'
" https://github.com/akinsho/bufferline.nvim
Plug 'akinsho/bufferline.nvim', { 'tag': '*' }
" https://github.com/tiagovla/scope.nvim
Plug 'tiagovla/scope.nvim'
" https://github.com/nvim-lualine/lualine.nvim
Plug 'nvim-lualine/lualine.nvim'
" https://github.com/RRethy/vim-illuminate
" Plug 'RRethy/vim-illuminate'
" https://github.com/APZelos/Blamer.nvim
Plug 'APZelos/blamer.nvim'
" https://github.com/morhetz/gruvbox
Plug 'morhetz/gruvbox'
call plug#end()
colorscheme gruvbox
let g:blamer_template = '[<commit-short>] • <author>, <committer-time> • <summary>'
lua << EOF
require 'lspconfig'.clangd.setup {}
require 'telescope'.load_extension 'file_browser'
require 'bufferline'.setup {
options = {
show_buffer_icons = false,
separator_style = 'slope',
style_preset = {
require 'bufferline'.style_preset.no_italic
}
}
}
require 'lualine'.setup {}
require 'scope'.setup {}
require 'telescope'.load_extension 'scope'
EOF
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fb <cmd>Telescope file_browser<cr>
nnoremap <leader>fs <cmd>Telescope live_grep<cr>
nnoremap <leader>fd <cmd>Telescope lsp_definitions jump_type=never<cr>
nnoremap <leader>fr <cmd>Telescope lsp_references jump_type=never<cr>
nnoremap <leader>fi <cmd>Telescope lsp_implementations jump_type=never<cr>
nnoremap <leader>gb <cmd>BlamerToggle<cr>
nnoremap <leader>gh <cmd>DiffviewFileHistory %<cr>
nnoremap L <cmd>bnext<cr>
nnoremap H <cmd>bprev<cr>
autocmd VimEnter * TSEnable highlight
# dependencies
```
sudo apt install -y curl ripgrep git software-properties-common \
build-essential clang clang-tools clangd
```
# neovim
```
sudo add-apt-repository ppa:neovim-ppa/unstable
sudo apt update
sudo apt install neovim
```
```
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'
```
```
:PlugInstall
```
```
:TSInstall c
:TSInstall cpp
:TSInstall javascript
:TSInstall python
```
# fonts
```
mkdir -p $HOME/.local/share/fonts
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/UbuntuMono.zip \
-O $HOME/.local/share/fonts/UbuntuMono.zip
unzip $HOME/.local/share/fonts/UbuntuMono.zip \
-d $HOME/.local/share/fonts
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment