63484f6704
https://stackoverflow.com/questions/51059357/vim-wrong-indent-when-comment-lines-of-yaml-file
141 lines
3.9 KiB
Lua
141 lines
3.9 KiB
Lua
vim.opt.syntax = 'on'
|
|
vim.cmd("filetype plugin indent on")
|
|
vim.opt.number = true
|
|
-- set relativenumber
|
|
vim.opt.relativenumber = false
|
|
--vim.opt.path += "**"
|
|
vim.opt.swapfile = false
|
|
vim.opt.wildmenu = true
|
|
vim.opt.backspace = "indent,eol,start"
|
|
vim.opt.undodir = "/home/ateijelo/.cache/nvim/undo"
|
|
vim.opt.undofile = true
|
|
vim.opt.incsearch = true
|
|
vim.opt.smartindent = true
|
|
vim.opt.ic = true
|
|
-- set colorcolumn=88
|
|
vim.opt.et = true
|
|
vim.opt.ts = 4
|
|
vim.opt.sw = 4
|
|
--set showmatch
|
|
vim.opt.hlsearch = true
|
|
--incsearch
|
|
vim.cmd("highlight ColorColumn ctermbg=9")
|
|
vim.cmd("autocmd FileType yaml,yaml.ansible setlocal indentkeys-=0#")
|
|
|
|
-- don't use NeoVim's thin cursor
|
|
vim.opt.guicursor = ""
|
|
|
|
require("colorschemes")
|
|
|
|
vim.cmd("hi MatchParen cterm=bold,underline gui=bold,underline")
|
|
|
|
vim.api.nvim_set_keymap("n", "<SPACE>", "<Nop>", { noremap = true })
|
|
vim.g.mapleader = " "
|
|
|
|
for _, mode in ipairs({"n", "i"}) do
|
|
vim.api.nvim_set_keymap(mode, "<Up>", "g<Up>", { noremap = true })
|
|
vim.api.nvim_set_keymap(mode, "<Down>", "g<Down>", { noremap = true })
|
|
vim.api.nvim_set_keymap(mode, "<Left>", "<Nop>", { noremap = true })
|
|
vim.api.nvim_set_keymap(mode, "<Right>", "<Nop>", { noremap = true })
|
|
vim.api.nvim_set_keymap(mode, "<Down>", "<Nop>", { noremap = true })
|
|
vim.api.nvim_set_keymap(mode, "<Up>", "<Nop>", { noremap = true })
|
|
end
|
|
|
|
vim.api.nvim_set_keymap("n", "<Leader>o", "<Cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true })
|
|
vim.api.nvim_set_keymap("n", "<M-o>", "<Cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true })
|
|
vim.api.nvim_set_keymap("n", "<Leader>i", "<Cmd>lua vim.lsp.buf.code_action()<CR>", { noremap = true })
|
|
vim.api.nvim_set_keymap("n", "<M-i>", "<Cmd>lua vim.lsp.buf.code_action()<CR>", { noremap = true })
|
|
|
|
require('plugins')
|
|
-- require'lspconfig'.pyright.setup{}
|
|
local nvim_lsp = require'lspconfig'
|
|
nvim_lsp.pyright.setup{}
|
|
|
|
-- local on_attach = function(client)
|
|
-- require'completion'.on_attach(client)
|
|
-- end
|
|
|
|
|
|
-- require('snippy').setup({
|
|
-- mappings = {
|
|
-- is = {
|
|
-- ['<Tab>'] = 'expand_or_advance',
|
|
-- ['<S-Tab>'] = 'previous',
|
|
-- },
|
|
-- nx = {
|
|
-- ['<leader>x'] = 'cut_text',
|
|
-- },
|
|
-- },
|
|
-- })
|
|
|
|
require('completion')
|
|
|
|
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
nvim_lsp.rust_analyzer.setup({
|
|
capabilities = capabilities,
|
|
settings = {
|
|
["rust-analyzer"] = {
|
|
}
|
|
}
|
|
})
|
|
|
|
vim.diagnostic.config({
|
|
underline = true,
|
|
signs = true,
|
|
virtual_text = true,
|
|
float = {
|
|
show_header = true,
|
|
source = 'if_many',
|
|
border = 'rounded',
|
|
focusable = false,
|
|
}
|
|
})
|
|
|
|
require('treesitter')
|
|
|
|
-- -- trouble.nvim mappings
|
|
-- vim.api.nvim_set_keymap("n", "<leader>xx", "<cmd>Trouble<cr>",
|
|
-- {silent = true, noremap = true}
|
|
-- )
|
|
-- vim.api.nvim_set_keymap("n", "<leader>xw", "<cmd>Trouble workspace_diagnostics<cr>",
|
|
-- {silent = true, noremap = true}
|
|
-- )
|
|
-- vim.api.nvim_set_keymap("n", "<leader>xd", "<cmd>Trouble document_diagnostics<cr>",
|
|
-- {silent = true, noremap = true}
|
|
-- )
|
|
-- vim.api.nvim_set_keymap("n", "<leader>xl", "<cmd>Trouble loclist<cr>",
|
|
-- {silent = true, noremap = true}
|
|
-- )
|
|
-- vim.api.nvim_set_keymap("n", "<leader>xq", "<cmd>Trouble quickfix<cr>",
|
|
-- {silent = true, noremap = true}
|
|
-- )
|
|
-- vim.api.nvim_set_keymap("n", "gR", "<cmd>Trouble lsp_references<cr>",
|
|
-- {silent = true, noremap = true}
|
|
-- )
|
|
--
|
|
|
|
-- original init.vim
|
|
-- syntax on
|
|
-- hi MatchParen ctermfg=none ctermbg=none cterm=bold,underline gui=bold,underline guifg=fg guibg=bg
|
|
--
|
|
-- filetype plugin indent on
|
|
-- set number
|
|
-- "set relativenumber
|
|
-- set path+=**
|
|
-- set noswapfile
|
|
-- set wildmenu
|
|
-- set backspace=indent,eol,start
|
|
-- set undodir=~/.cache/nvim/undo
|
|
-- set undofile
|
|
-- set incsearch
|
|
-- set smartindent
|
|
-- set ic
|
|
-- "set colorcolumn=88
|
|
-- set et
|
|
-- set ts=4
|
|
-- set sw=4
|
|
-- "set showmatch
|
|
-- set hlsearch incsearch
|
|
-- "highlight ColorColumn ctermbg=9
|
|
--
|
|
-- lua require('plugins')
|