144 lines
3.8 KiB
Lua
144 lines
3.8 KiB
Lua
vim.opt.number = true
|
|
vim.opt.wrap = false
|
|
vim.opt.undofile = true
|
|
vim.opt.backup = true
|
|
vim.opt.ignorecase = true
|
|
vim.opt.smartcase = true
|
|
vim.opt.list = true
|
|
vim.opt.cursorline = true
|
|
vim.opt.scrolloff = 5
|
|
vim.opt.shiftwidth = 8
|
|
vim.opt.tabstop = 8
|
|
vim.opt.expandtab = false
|
|
vim.opt.guicursor = "i:blinkon1"
|
|
vim.opt.listchars = 'trail:~,tab:| '
|
|
vim.opt.backupdir = '/home/matuush/.local/state/nvim/backup//'
|
|
|
|
vim.g.netrw_banner = 0
|
|
vim.g.netrw_liststyle = 3
|
|
vim.g.netrw_winsize = 15
|
|
vim.g.netrw_keepdir = 0
|
|
vim.g.loaded_perl_provider = 0
|
|
vim.g.loaded_ruby_provider = 0
|
|
|
|
vim.cmd([[
|
|
syntax on
|
|
filetype plugin on
|
|
hi clear CursorLineNR
|
|
hi CursorLineNR guibg=darkgrey guifg=black
|
|
colorscheme jellybeans
|
|
highlight DiagnosticUnderlineError guifg=red
|
|
highlight DiagnosticUnderlineWarn guifg=orange
|
|
|
|
let g:OmniSharp_server_use_net6 = 1
|
|
|
|
nnoremap J j
|
|
nnoremap <BS> :w<Enter>
|
|
nnoremap ; mKA;<Esc>'K
|
|
nnoremap <Space> :lua vim.diagnostic.open_float()<enter>
|
|
nnoremap <c-n> :lua vim.diagnostic.goto_prev()<enter>
|
|
nnoremap <c-N> :lua vim.diagnostic.goto_next()<enter>
|
|
inoremap <C-space> <C-x><C-o>
|
|
inoremap ( ()<Esc>i
|
|
inoremap [ []<Esc>i
|
|
inoremap { {}<Esc>i
|
|
noremap <C-u> :w<CR>:!arduino-cli compile --fqbn arduino:avr:uno && arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:avr:uno<CR>
|
|
]])
|
|
|
|
require'packer'.startup(function()
|
|
use 'nanotech/jellybeans.vim'
|
|
use 'neovim/nvim-lspconfig'
|
|
use 'tpope/vim-abolish'
|
|
use 'tpope/vim-fugitive'
|
|
use 'tpope/vim-repeat'
|
|
use 'tpope/vim-surround'
|
|
use 'wbthomason/packer.nvim'
|
|
use {'nvim-lualine/lualine.nvim', requires = { 'nvim-tree/nvim-web-devicons', opt = true }}
|
|
use { "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, }
|
|
use 'OmniSharp/omnisharp-vim'
|
|
end)
|
|
|
|
vim.diagnostic.config{
|
|
virtual_text = false,
|
|
signs = false,
|
|
underline = true,
|
|
float = {
|
|
scope = 'cursor'
|
|
},
|
|
jump = {
|
|
float = true
|
|
},
|
|
update_in_insert = true
|
|
}
|
|
|
|
local function map(a, b, c) vim.keymap.set(a, b, c, { silent = true, noremap = true }) end
|
|
|
|
local on_attach = function(client, _)
|
|
map('n', 'gD', vim.lsp.buf.declaration)
|
|
map('n', 'gd', vim.lsp.buf.definition)
|
|
map('n', 'gr', vim.lsp.buf.references)
|
|
map('n', '[d', vim.diagnostic.goto_prev)
|
|
map('n', ']d', vim.diagnostic.goto_next)
|
|
map('n', '<S-k>', vim.lsp.buf.hover)
|
|
--map('n', '<space>f', vim.lsp.buf.format)
|
|
--map('n', '<space>rn', vim.lsp.buf.rename)
|
|
--map('n', '<space>ca', vim.lsp.buf.code_action)
|
|
end
|
|
|
|
require'lspconfig'.clangd.setup{ on_attach = on_attach }
|
|
require'lspconfig'.pyright.setup{ on_attach = on_attach }
|
|
require'lspconfig'.ruff.setup{ on_attach = on_attach }
|
|
require'lspconfig'.ts_ls.setup{ on_attach = on_attach }
|
|
require'lspconfig'.tailwindcss.setup{ on_attach = on_attach }
|
|
require'lspconfig'.texlab.setup{ on_attach = on_attach }
|
|
require'lspconfig'.bashls.setup{ on_attach = on_attach }
|
|
require'lspconfig'.omnisharp.setup{
|
|
cmd = { 'omnisharp' },
|
|
settings = {
|
|
FormattingOptions = {
|
|
EnableEditorConfigSupport = false,
|
|
OrganizeImports = nil,
|
|
},
|
|
RoslynExtensionsOptions = {
|
|
EnableAnalyzersSupport = true,
|
|
EnableImportCompletion = true,
|
|
AnalyzeOpenDocumentsOnly = nil,
|
|
},
|
|
MsBuild = {
|
|
LoadProjectsOnDemand = true,
|
|
},
|
|
Sdk = {
|
|
IncludePrereleases = false,
|
|
},
|
|
},
|
|
on_attach = on_attach
|
|
}
|
|
require'lspconfig'.arduino_language_server.setup {
|
|
filetypes = {"arduino"},
|
|
cmd = {
|
|
"arduino-language-server",
|
|
"-cli-config", "/home/matuush/.arduino15/arduino-cli.yaml",
|
|
"-fqbn", "arduino:avr:uno"
|
|
},
|
|
on_attach = on_attach,
|
|
capabilities = {
|
|
textDocument = {
|
|
semanticTokens = vim.NIL
|
|
},
|
|
workspace = {
|
|
semanticTokens = vim.NIL
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
require'lualine'.setup{
|
|
sections = {
|
|
lualine_a = {'mode'},
|
|
lualine_b = {'branch'},
|
|
lualine_c = {'diff', 'diagnostics'},
|
|
lualine_x = {'filename'},
|
|
lualine_y = {},
|
|
lualine_z = {'location'}
|
|
}
|
|
}
|