init.vim 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. syntax on
  2. filetype plugin indent on
  3. let mapleader = " "
  4. " Plugins
  5. call plug#begin('~/.vim/plugged')
  6. Plug 'neovim/nvim-lspconfig'
  7. Plug 'neovim/nvim-lspconfig'
  8. Plug 'hrsh7th/cmp-nvim-lsp'
  9. Plug 'hrsh7th/cmp-buffer'
  10. Plug 'hrsh7th/cmp-path'
  11. Plug 'hrsh7th/cmp-cmdline'
  12. " For vsnip users.
  13. Plug 'L3MON4D3/LuaSnip'
  14. Plug 'hrsh7th/nvim-cmp'
  15. Plug 'hrsh7th/cmp-buffer'
  16. Plug 'hrsh7th/cmp-path'
  17. Plug 'hrsh7th/cmp-nvim-lua'
  18. Plug 'hrsh7th/cmp-nvim-lsp'
  19. Plug 'saadparwaiz1/cmp_luasnip'
  20. ""Plug 'hrsh7th/vim-vsnip'
  21. Plug 'chriskempson/base16-vim'
  22. Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update
  23. Plug 'kaicataldo/material.vim', { 'branch': 'main' }
  24. Plug 'nvim-lua/popup.nvim'
  25. Plug 'nvim-lua/plenary.nvim'
  26. Plug 'nvim-telescope/telescope.nvim'
  27. Plug 'itchyny/lightline.vim'
  28. Plug 'joshdick/onedark.vim'
  29. Plug 'rust-lang/rust.vim'
  30. call plug#end()
  31. lua require('init')
  32. " General vim configurations
  33. set relativenumber
  34. set colorcolumn=80
  35. set updatetime=50
  36. set tabstop=4 softtabstop=4
  37. set expandtab
  38. set smartindent
  39. set completeopt=menu,menuone,noselect
  40. set noswapfile
  41. set nobackup
  42. set scrolloff=8
  43. set signcolumn=yes
  44. set nowrap
  45. set nu
  46. set hidden
  47. set undodir=~/.config/nvim/undodir
  48. set undofile
  49. " Theme settings
  50. " https://github.com/kaicataldo/material.vim
  51. if (has('termguicolors'))
  52. set termguicolors
  53. endif
  54. let g:material_theme_style = 'darker'
  55. colorscheme material
  56. " Lsp configuration for multiple languages
  57. " Use <Tab> and <S-Tab> to navigate through popup menu
  58. "inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
  59. "inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
  60. " Tree-sitter config
  61. lua require'nvim-treesitter.configs'.setup { highlight = { enable = true }, incremental_selection = { enable = true }, textobjects = { enable = true }}
  62. " keyboard shortcut options
  63. nnoremap <leader>n gt
  64. nnoremap <leader>m gT
  65. " Telescope shortcuts
  66. nnoremap <leader>ff <cmd>Telescope find_files<cr>
  67. nnoremap <leader>fg <cmd>Telescope live_grep<cr>
  68. nnoremap <leader>fb <cmd>Telescope buffers<cr>
  69. nnoremap <leader>fh <cmd>Telescope help_tags<cr>