init
commit
1994ce652e
@ -0,0 +1,78 @@
|
||||
set noerrorbells
|
||||
set history=500
|
||||
set autoread
|
||||
set ruler
|
||||
set number
|
||||
set expandtab
|
||||
set smarttab
|
||||
set smartindent
|
||||
set nowrap
|
||||
set smartcase
|
||||
set noswapfile
|
||||
set nobackup
|
||||
set undodir=~/.nvim/undodir
|
||||
set undofile
|
||||
set incsearch
|
||||
set shiftwidth=4
|
||||
set tabstop=4 softtabstop=4
|
||||
set encoding=utf-8
|
||||
set fileencoding=utf-8
|
||||
set relativenumber
|
||||
set scrolloff=8
|
||||
set hidden
|
||||
set signcolumn=yes
|
||||
set colorcolumn=110
|
||||
|
||||
autocmd BufWritePost *.tex !echo | pdflatex % >/dev/null
|
||||
|
||||
call plug#begin("~/.nvim/plugged")
|
||||
Plug 'rust-lang/rust.vim'
|
||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'mbbill/undotree'
|
||||
Plug 'sbdchd/neoformat'
|
||||
Plug 'gruvbox-community/gruvbox'
|
||||
Plug 'folke/tokyonight.nvim', { 'branch': 'main' }
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
Plug 'nvim-telescope/telescope.nvim'
|
||||
Plug 'nvim-telescope/telescope-fzy-native.nvim'
|
||||
Plug 'psliwka/vim-smoothie'
|
||||
Plug 'darrikonn/vim-gofmt', { 'do': ':GoUpdateBinaries' }
|
||||
"Plug 'fatih/vim-go'
|
||||
Plug 'preservim/nerdtree'
|
||||
Plug 'udalov/kotlin-vim'
|
||||
|
||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
||||
Plug 'hrsh7th/cmp-buffer'
|
||||
Plug 'hrsh7th/nvim-cmp'
|
||||
Plug 'L3MON4D3/LuaSnip'
|
||||
Plug 'EdenEast/nightfox.nvim'
|
||||
Plug 'itchyny/lightline.vim'
|
||||
"EEEEEEEEEEEEEEEEEEEEEEEEEEEee
|
||||
Plug 'ThePrimeagen/vim-be-good'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'simrat39/rust-tools.nvim'
|
||||
|
||||
call plug#end()
|
||||
|
||||
"colorscheme gruvbox
|
||||
colorscheme tokyonight
|
||||
|
||||
let mapleader = " "
|
||||
|
||||
nnoremap <C-p> :lua require ('telescope.builtin').git_files()<CR>
|
||||
nnoremap <C-f> :lua require ('telescope.builtin').find_files()<CR>
|
||||
nnoremap <leader>f :lua require('telescope.builtin').live_grep()<CR>
|
||||
nnoremap <leader><tab> :lua require('telescope.builtin').buffers()<CR>
|
||||
"nnoremap <leader><tab> :b<space>
|
||||
nnoremap <leader>y "+y
|
||||
|
||||
lua require("init")
|
||||
|
||||
nnoremap gd :lua vim.lsp.buf.definition()<CR>
|
||||
nnoremap K :lua vim.lsp.buf.hover()<CR>
|
||||
nnoremap L :lua vim.diagnostic.open_float()<CR>
|
||||
|
||||
"autocmd BufWritePost *.go GoImports
|
||||
|
||||
nnoremap <C-n> :NERDTreeToggle<CR>
|
@ -0,0 +1,94 @@
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
--vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<Tab>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
-- { name = 'vsnip' }, -- For vsnip users.
|
||||
{ name = 'luasnip' }, -- For luasnip users.
|
||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||
-- { name = 'snippy' }, -- For snippy users.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
require("lspconfig").tsserver.setup({})
|
||||
|
||||
require("lspconfig").clangd.setup({})
|
||||
require("lspconfig").gopls.setup({
|
||||
cmd = { "gopls", "serve" },
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("lspconfig").rust_analyzer.setup({
|
||||
--cmd = { "rustup", "run", "nightly", "rust-analyzer" },
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
checkOnSave = {
|
||||
allFeatures = true,
|
||||
|
||||
overrideCommand = {
|
||||
'cargo', 'clippy', '--workspace', '--message-format=json',
|
||||
'--all-targets', '--all-features'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
require('lspconfig').kotlin_language_server.setup({
|
||||
cmd = { "kotlin-language-server" },
|
||||
filetypes = { "kotlin"} ,
|
||||
})
|
||||
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
update_in_insert = true,
|
||||
}
|
||||
)
|
||||
|
Loading…
Reference in New Issue