init.vim 2.1 KB

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