start full-soy vim config, change colors a bit, general YOLO commit

This commit is contained in:
Grigory Shipunov 2022-10-02 02:21:55 +02:00
parent 4ff5fc37a6
commit 4bda92d47d
Signed by: 0xa
GPG key ID: 91FA5E5BF9AA901C
17 changed files with 439 additions and 120 deletions

View file

@ -0,0 +1,44 @@
-- nvim cmp
return require'cmp'.setup({
snippet = {
expand = function(args)
require'snippy'.expand_snippet(args.body)
end
},
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({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
})
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'snippy' }, -- For snippy users.
{ name = 'buffer' },
{ name = 'path' },
{ name = 'nvim_lua' },
}),
formatting = {
format = function(entry, vim_item)
vim_item.kind = string.format('%s', vim_item.kind)
vim_item.menu = ({
nvim_lsp = '[LSP]',
buffer = '[B]',
path = '[F]',
snippy = '[S]',
nvim_lua = '[vim]',
})[entry.source.name]
return vim_item
end,
}
})

View file

@ -0,0 +1,3 @@
require'lspconfig'.rnix.setup{
autostart = false,
}

View file

@ -0,0 +1,32 @@
-- nvim_lsp object
local nvim_lsp = require'lspconfig'
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
-- Enable rust_analyzer
nvim_lsp.rust_analyzer.setup({
autostart=false,
capabilities=capabilities,
-- on_attach is a callback called when the language server attachs to the buffer
-- on_attach = on_attach,
settings = {
-- to enable rust-analyzer settings visit:
-- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
["rust-analyzer"] = {
-- enable clippy diagnostics on save
checkOnSave = {
command = "clippy"
},
}
}
})
-- Enable diagnostics
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = false,
signs = true,
update_in_insert = true,
}
)

View file

@ -0,0 +1,59 @@
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
-- insert images into markdown automagically
use 'ferrine/md-img-paste.vim'
--Better syntax
use 'rust-lang/rust.vim'
use 'LnL7/vim-nix'
use 'cespare/vim-toml'
use 'JuliaEditorSupport/julia-vim'
use 'lervag/vimtex'
use 'lepture/vim-jinja'
use 'neomutt/neomutt.vim'
use 'godlygeek/tabular'
use 'preservim/vim-markdown'
-- pretty bits
use 'bluz71/vim-moonfly-colors'
use 'vim-airline/vim-airline'
-- neovim VSCode edition
use 'neovim/nvim-lspconfig'
use 'simrat39/rust-tools.nvim'
-- completion
use 'hrsh7th/nvim-cmp'
use 'hrsh7th/cmp-nvim-lsp'
use 'hrsh7th/cmp-buffer'
use 'hrsh7th/cmp-path'
use 'hrsh7th/cmp-nvim-lua'
-- just because cmp requires snippet
use 'dcampos/nvim-snippy'
use 'dcampos/cmp-snippy'
-- navigating files
use 'junegunn/fzf'
use 'junegunn/fzf.vim'
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if packer_bootstrap then
require('packer').sync()
end
end)