dotfiles/.config/nvim/init.lua

113 lines
2.6 KiB
Lua

vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = false
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.ruler = true
vim.opt.backup = false
vim.opt.number = true
vim.opt.colorcolumn = "120"
vim.opt.exrc = true
vim.opt.secure = true
vim.opt.hidden = true
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
vim.opt.shortmess:append('c')
-- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
-- delays and poor user experience.
vim.opt.updatetime = 300
-- Always show the signcolumn, otherwise it would shift the text each time
-- diagnostics appear/become resolved.
-- Recently vim can merge signcolumn and number column into one
vim.opt.signcolumn = 'yes'
vim.opt.mouse = 'a' -- " Enable mouse in all modes.
--
-- Packer
--
vim.cmd [[packadd packer.nvim]]
require'packer'.startup(function()
-- Packer can manage itself
use 'wbthomason/packer.nvim'
use 'mfussenegger/nvim-dap'
use 'airblade/vim-gitgutter'
use 'neovim/nvim-lspconfig'
use 'dense-analysis/ale'
use 'liuchengxu/vista.vim' -- Tag bar.
use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate'
}
-- Git.
use 'tpope/vim-fugitive'
use {
'sindrets/diffview.nvim',
requires = {'nvim-lua/plenary.nvim'}
}
-- File browser.
use {
'kyazdani42/nvim-tree.lua',
requires = {'nvim-tree/nvim-web-devicons'} -- optional, for file icon
}
use {
'nvim-telescope/telescope.nvim',
requires = {'nvim-lua/plenary.nvim'}
}
use 'nvim-telescope/telescope-ui-select.nvim'
use {
'kevinhwang91/nvim-ufo',
requires = {'kevinhwang91/promise-async'}
}
-- Theme.
use 'qaptoR-nvim/chocolatier.nvim'
use {
'nvim-lualine/lualine.nvim',
requires = {'nvim-tree/nvim-web-devicons'} -- optional, for status line icons
}
-- Syntax.
use 'leafOfTree/vim-vue-plugin'
use 'mfussenegger/nvim-jdtls'
use 'dart-lang/dart-vim-plugin'
use {
'akinsho/flutter-tools.nvim',
requires = {
'nvim-lua/plenary.nvim'
}
}
use 'vim-vdebug/vdebug'
-- nvim-cmp
use 'dcampos/nvim-snippy'
use 'hrsh7th/cmp-nvim-lsp'
use 'hrsh7th/nvim-cmp'
use 'dcampos/cmp-snippy'
use 'hrsh7th/cmp-path'
use 'hrsh7th/cmp-buffer'
end)
require'plugins'
require'lspserver'
--
-- Theme
--
vim.cmd('colorscheme chocolatier')
vim.opt.termguicolors = true
-- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap = true, silent = true }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)