Update neovim config. Remote lsp-zero
This commit is contained in:
parent
139dcc31d3
commit
e115f6e8d6
85
dot_config/nvim/after/plugin/cmp.lua
Normal file
85
dot_config/nvim/after/plugin/cmp.lua
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
local ok, cmp = pcall(require, 'cmp')
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
|
|
||||||
|
local luasnip = require('luasnip')
|
||||||
|
local lspkind = require('lspkind')
|
||||||
|
local select_opts = {behavior = cmp.SelectBehavior.Select}
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{name = 'path'},
|
||||||
|
{name = 'nvim_lsp', keyword_length = 1},
|
||||||
|
{name = 'buffer', keyword_length = 3},
|
||||||
|
{name = 'luasnip', keyword_length = 2},
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
documentation = cmp.config.window.bordered()
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
format = lspkind.cmp_format({
|
||||||
|
mode = 'symbol_text', -- show only symbol annotations
|
||||||
|
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<Up>'] = cmp.mapping.select_prev_item(select_opts),
|
||||||
|
['<Down>'] = cmp.mapping.select_next_item(select_opts),
|
||||||
|
|
||||||
|
['<C-p>'] = cmp.mapping.select_prev_item(select_opts),
|
||||||
|
['<C-n>'] = cmp.mapping.select_next_item(select_opts),
|
||||||
|
|
||||||
|
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
|
||||||
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
['<C-y>'] = cmp.mapping.confirm({select = true}),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({select = false}),
|
||||||
|
|
||||||
|
['<C-f>'] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.jumpable(1) then
|
||||||
|
luasnip.jump(1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {'i', 's'}),
|
||||||
|
|
||||||
|
['<C-b>'] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {'i', 's'}),
|
||||||
|
|
||||||
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
local col = vim.fn.col('.') - 1
|
||||||
|
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item(select_opts)
|
||||||
|
elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
||||||
|
fallback()
|
||||||
|
else
|
||||||
|
cmp.complete()
|
||||||
|
end
|
||||||
|
end, {'i', 's'}),
|
||||||
|
|
||||||
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item(select_opts)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, {'i', 's'}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
|
14
dot_config/nvim/after/plugin/hop.lua
Normal file
14
dot_config/nvim/after/plugin/hop.lua
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
local ok, hop = pcall(require, 'hop')
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
hop.setup {
|
||||||
|
quit_key = '<SPC>',
|
||||||
|
uppercase_labels = true
|
||||||
|
}
|
||||||
|
|
||||||
|
local map = vim.keymap.set
|
||||||
|
map('n', 'f', function() hop.hint_char1({current_line_only = true }) end, {remap=true})
|
||||||
|
map('n', '<leader>s', function() hop.hint_char2() end, {remap=true})
|
||||||
|
|
@ -1,95 +1,21 @@
|
|||||||
local ok, lsp = pcall(require, 'lsp-zero')
|
local ok, lsp = pcall(require, 'lspconfig')
|
||||||
if not ok then
|
if not ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
lsp.preset("recommended")
|
local sign = function(opts)
|
||||||
|
-- See :help sign_define()
|
||||||
-- Fix Undefined global 'vim'
|
vim.fn.sign_define(opts.name, {
|
||||||
lsp.configure('sumneko_lua', {
|
texthl = opts.name,
|
||||||
settings = {
|
text = opts.text,
|
||||||
Lua = {
|
numhl = ''
|
||||||
diagnostics = {
|
|
||||||
globals = { 'vim' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
local has_words_before = function()
|
|
||||||
unpack = unpack or table.unpack
|
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local luasnip = require("luasnip")
|
|
||||||
local cmp = require('cmp')
|
|
||||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
|
||||||
local cmp_mappings = lsp.defaults.cmp_mappings({
|
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
})
|
|
||||||
|
|
||||||
local lspkind = require('lspkind')
|
|
||||||
local cmp_formatting = {
|
|
||||||
format = lspkind.cmp_format({
|
|
||||||
mode = 'symbol_text', -- show only symbol annotations
|
|
||||||
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
lsp.setup_nvim_cmp({
|
|
||||||
mapping = cmp_mappings,
|
|
||||||
formatting = cmp_formatting
|
|
||||||
})
|
|
||||||
|
|
||||||
lsp.on_attach(function(client, bufnr)
|
|
||||||
local bufmap = function(mode, lhs, rhs)
|
|
||||||
local opts = {buffer = true, remap = false}
|
|
||||||
vim.keymap.set(mode, lhs, rhs, opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- List diagnostics in Telescope
|
|
||||||
bufmap('n', 'gA', '<cmd>Telescope diagnostics<cr>')
|
|
||||||
|
|
||||||
-- Lists all the references
|
|
||||||
bufmap('n', 'gr', '<cmd>Telescope lsp_references<cr>')
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
local on_attach_format = function(client)
|
|
||||||
require("lsp-format").on_attach(client)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
lsp.configure('clangd', {
|
sign({name = 'DiagnosticSignError', text = '✘'})
|
||||||
on_attach = on_attach_format
|
sign({name = 'DiagnosticSignWarn', text = '▲'})
|
||||||
})
|
sign({name = 'DiagnosticSignHint', text = '⚑'})
|
||||||
|
sign({name = 'DiagnosticSignInfo', text = ''})
|
||||||
lsp.nvim_workspace()
|
|
||||||
lsp.setup()
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
@ -101,3 +27,67 @@ vim.diagnostic.config({
|
|||||||
prefix = '',
|
prefix = '',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
|
||||||
|
vim.lsp.handlers.hover,
|
||||||
|
{border = 'rounded'}
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
|
||||||
|
vim.lsp.handlers.signature_help,
|
||||||
|
{border = 'rounded'}
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.lsp.handlers["workspace/diagnostic/refresh"] = function(_, _, ctx)
|
||||||
|
local ns = vim.lsp.diagnostic.get_namespace(ctx.client_id)
|
||||||
|
pcall(vim.diagnostic.reset, ns)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
require("lsp-format").setup {}
|
||||||
|
|
||||||
|
local on_attach = function(client)
|
||||||
|
local bufmap = function(mode, lhs, rhs)
|
||||||
|
local opts = {buffer = true}
|
||||||
|
vim.keymap.set(mode, lhs, rhs, opts)
|
||||||
|
end
|
||||||
|
require("lsp-format").on_attach(client)
|
||||||
|
|
||||||
|
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
||||||
|
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
||||||
|
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
|
||||||
|
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
|
||||||
|
bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
|
||||||
|
bufmap('n', 'gA', '<cmd>Telescope diagnostics<cr>')
|
||||||
|
bufmap('n', 'gr', '<cmd>Telescope lsp_references<cr>')
|
||||||
|
bufmap('n', 'gi', '<cmd>Telescope lsp_implementations<cr>')
|
||||||
|
bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
||||||
|
bufmap('n', '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>')
|
||||||
|
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
||||||
|
bufmap('x', '<F4>', '<cmd>lua vim.lsp.buf.range_code_action()<cr>')
|
||||||
|
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
||||||
|
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
||||||
|
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
||||||
|
end
|
||||||
|
|
||||||
|
lsp.gopls.setup { on_attach = on_attach }
|
||||||
|
lsp.clangd.setup { on_attach = on_attach }
|
||||||
|
lsp.ltex.setup { on_attach = on_attach }
|
||||||
|
lsp.svelte.setup { on_attach = on_attach }
|
||||||
|
lsp.tsserver.setup { on_attach = on_attach }
|
||||||
|
lsp.lua_ls.setup {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = { 'vim' }
|
||||||
|
},
|
||||||
|
-- workspace = {
|
||||||
|
-- library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
-- },
|
||||||
|
-- telemetry = {
|
||||||
|
-- enable = false,
|
||||||
|
-- },
|
||||||
|
}
|
||||||
|
},
|
||||||
|
on_attach = on_attach
|
||||||
|
}
|
||||||
|
@ -32,3 +32,4 @@ map('n',"<leader>f", "<cmd>Telescope live_grep<cr>")
|
|||||||
map('n',"<leader>g", "<cmd>Telescope grep_string<cr>")
|
map('n',"<leader>g", "<cmd>Telescope grep_string<cr>")
|
||||||
map('n',"<leader>b", "<cmd>Telescope buffers<cr>")
|
map('n',"<leader>b", "<cmd>Telescope buffers<cr>")
|
||||||
map('n',"<leader>h", "<cmd>Telescope help_tags<cr>")
|
map('n',"<leader>h", "<cmd>Telescope help_tags<cr>")
|
||||||
|
map('n',"z=", "<cmd>Telescope spell_suggest<cr>")
|
||||||
|
@ -5,24 +5,31 @@ end
|
|||||||
|
|
||||||
|
|
||||||
treesitter.setup {
|
treesitter.setup {
|
||||||
-- A list of parser names, or "all"
|
textobjects = {
|
||||||
ensure_installed = "all",
|
select = {
|
||||||
|
enable = true,
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
lookahead = true,
|
||||||
sync_install = false,
|
keymaps = {
|
||||||
|
['af'] = '@function.outer',
|
||||||
-- Automatically install missing parsers when entering buffer
|
['if'] = '@function.inner',
|
||||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
['ac'] = '@class.outer',
|
||||||
auto_install = true,
|
['ic'] = '@class.inner',
|
||||||
|
}
|
||||||
highlight = {
|
},
|
||||||
-- `false` will disable the whole extension
|
},
|
||||||
|
ensure_installed = {
|
||||||
|
'javascript',
|
||||||
|
'typescript',
|
||||||
|
'css',
|
||||||
|
'json',
|
||||||
|
'c',
|
||||||
|
'lua',
|
||||||
|
'go'
|
||||||
|
},
|
||||||
|
sync_install = false,
|
||||||
|
auto_install = true,
|
||||||
|
highlight = {
|
||||||
enable = true,
|
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,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,26 +1,24 @@
|
|||||||
HOME = os.getenv("HOME")
|
HOME = os.getenv("HOME")
|
||||||
vim.cmd([[colorscheme gruvbox]])
|
vim.cmd([[colorscheme gruvbox]])
|
||||||
|
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = '\\'
|
vim.g.maplocalleader = '\\'
|
||||||
|
|
||||||
-- Plugins
|
-- Plugins
|
||||||
require "paq" {
|
require "paq" {
|
||||||
"savq/paq-nvim";
|
"savq/paq-nvim";
|
||||||
|
|
||||||
{"nvim-treesitter/nvim-treesitter", run=function() vim.cmd "TSUpdate" end};
|
"nvim-treesitter/nvim-treesitter";
|
||||||
"nvim-treesitter/nvim-treesitter-textobjects";
|
"nvim-treesitter/nvim-treesitter-textobjects";
|
||||||
|
|
||||||
"nvim-tree/nvim-web-devicons";
|
"nvim-tree/nvim-web-devicons";
|
||||||
"onsails/lspkind.nvim";
|
|
||||||
|
|
||||||
"VonHeikemen/lsp-zero.nvim";
|
|
||||||
|
|
||||||
-- LSP support
|
-- LSP support
|
||||||
|
"onsails/lspkind.nvim";
|
||||||
"lukas-reineke/lsp-format.nvim";
|
"lukas-reineke/lsp-format.nvim";
|
||||||
"neovim/nvim-lspconfig";
|
"neovim/nvim-lspconfig";
|
||||||
"williamboman/mason.nvim";
|
-- "williamboman/mason.nvim";
|
||||||
"williamboman/mason-lspconfig.nvim";
|
-- "williamboman/mason-lspconfig.nvim";
|
||||||
|
|
||||||
-- Autocomplete
|
-- Autocomplete
|
||||||
"hrsh7th/nvim-cmp";
|
"hrsh7th/nvim-cmp";
|
||||||
@ -34,38 +32,52 @@ require "paq" {
|
|||||||
"L3MON4D3/LuaSnip";
|
"L3MON4D3/LuaSnip";
|
||||||
"rafamadriz/friendly-snippets";
|
"rafamadriz/friendly-snippets";
|
||||||
|
|
||||||
|
-- Programming support
|
||||||
"kylechui/nvim-surround";
|
"kylechui/nvim-surround";
|
||||||
"windwp/nvim-autopairs";
|
"windwp/nvim-autopairs";
|
||||||
"numToStr/Comment.nvim";
|
"numToStr/Comment.nvim";
|
||||||
{"phaazon/hop.nvim", branch="v2"};
|
{"phaazon/hop.nvim", branch="v2"};
|
||||||
|
|
||||||
"nvim-lua/plenary.nvim";
|
|
||||||
|
|
||||||
-- Fuzzy search
|
-- Fuzzy search
|
||||||
{"nvim-telescope/telescope-fzf-native.nvim", run="gmake"};
|
{"nvim-telescope/telescope-fzf-native.nvim", run="gmake"};
|
||||||
"nvim-telescope/telescope-file-browser.nvim";
|
"nvim-telescope/telescope-file-browser.nvim";
|
||||||
"nvim-telescope/telescope.nvim";
|
"nvim-telescope/telescope.nvim";
|
||||||
|
"folke/trouble.nvim";
|
||||||
|
|
||||||
"mfussenegger/nvim-dap";
|
"mfussenegger/nvim-dap";
|
||||||
|
"theHamsta/nvim-dap-virtual-text";
|
||||||
"rcarriga/nvim-dap-ui";
|
"rcarriga/nvim-dap-ui";
|
||||||
|
|
||||||
|
"NvChad/nvim-colorizer.lua";
|
||||||
"lewis6991/gitsigns.nvim";
|
"lewis6991/gitsigns.nvim";
|
||||||
-- "ray-x/go.nvim";
|
"tpope/vim-fugitive";
|
||||||
"renerocksai/telekasten.nvim";
|
"renerocksai/telekasten.nvim";
|
||||||
"renerocksai/calendar-vim";
|
"renerocksai/calendar-vim";
|
||||||
|
"nvim-lua/plenary.nvim";
|
||||||
|
"akinsho/toggleterm.nvim";
|
||||||
|
|
||||||
"nvim-lualine/lualine.nvim";
|
"nvim-lualine/lualine.nvim";
|
||||||
"ellisonleao/gruvbox.nvim";
|
"ellisonleao/gruvbox.nvim";
|
||||||
}
|
}
|
||||||
|
|
||||||
require('nvim-web-devicons').setup {}
|
require('nvim-web-devicons').setup {}
|
||||||
require('lsp-format').setup {}
|
|
||||||
require('nvim-autopairs').setup()
|
|
||||||
require('nvim-surround').setup()
|
require('nvim-surround').setup()
|
||||||
require('Comment').setup()
|
require('Comment').setup()
|
||||||
require('hop').setup()
|
|
||||||
require('dapui').setup()
|
require('dapui').setup()
|
||||||
require('gitsigns').setup()
|
require('gitsigns').setup()
|
||||||
|
require("trouble").setup()
|
||||||
|
require('nvim-autopairs').setup({
|
||||||
|
fast_wrap = {},
|
||||||
|
})
|
||||||
|
|
||||||
|
require 'colorizer'.setup {
|
||||||
|
filetypes = {
|
||||||
|
'css',
|
||||||
|
'javascript',
|
||||||
|
scss = { rgb_fn = true; };
|
||||||
|
html = { mode = 'foreground'; }
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
require('lualine').setup {
|
require('lualine').setup {
|
||||||
options = {
|
options = {
|
||||||
@ -76,29 +88,27 @@ require('lualine').setup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require('toggleterm').setup({
|
||||||
|
open_mapping = '<C-g>',
|
||||||
|
direction = 'horizontal',
|
||||||
|
shade_terminals = true
|
||||||
|
})
|
||||||
|
|
||||||
require("gruvbox").setup {
|
require("gruvbox").setup {
|
||||||
italic = false,
|
italic = false,
|
||||||
contrast = "hard"
|
contrast = "hard"
|
||||||
}
|
}
|
||||||
|
|
||||||
local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {})
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
pattern = "*.go",
|
|
||||||
callback = function()
|
|
||||||
require('go.format').goimport()
|
|
||||||
end,
|
|
||||||
group = format_sync_grp,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Options
|
-- Options
|
||||||
local o = vim.opt
|
local o = vim.opt
|
||||||
|
|
||||||
-- basic settings
|
-- basic settings
|
||||||
o.encoding = "utf-8"
|
o.encoding = "utf-8"
|
||||||
o.backspace = "indent,eol,start" -- backspace works on every char in insert mode
|
o.backspace = "indent,eol,start" -- backspace works on every char in insert mode
|
||||||
o.completeopt = 'menu,menuone,noselect'
|
o.completeopt = {'menu', 'menuone', 'noselect'}
|
||||||
o.history = 1000
|
o.history = 1000
|
||||||
o.dictionary = '/usr/share/dict/words'
|
-- o.dictionary = '/home/jan/.vim/dict/words'
|
||||||
|
-- o.dictionary = '/usr/share/dict/words'
|
||||||
o.startofline = true
|
o.startofline = true
|
||||||
o.title = true
|
o.title = true
|
||||||
o.clipboard='unnamedplus'
|
o.clipboard='unnamedplus'
|
||||||
@ -108,7 +118,8 @@ o.timeoutlen = 200
|
|||||||
o.ttimeoutlen = 0
|
o.ttimeoutlen = 0
|
||||||
|
|
||||||
-- Spellchecker
|
-- Spellchecker
|
||||||
o.spelllang="en_us"
|
o.spell = false
|
||||||
|
o.spelllang = { 'en_us' }
|
||||||
o.spellfile= HOME .. '/.vim/spell/en.utf8.add'
|
o.spellfile= HOME .. '/.vim/spell/en.utf8.add'
|
||||||
o.thesaurus= HOME .. '/.vim/thesaurus/english.txt'
|
o.thesaurus= HOME .. '/.vim/thesaurus/english.txt'
|
||||||
|
|
||||||
@ -126,7 +137,6 @@ o.list = false -- do not display white characters
|
|||||||
o.termguicolors = true
|
o.termguicolors = true
|
||||||
o.background = "dark"
|
o.background = "dark"
|
||||||
-- o.updatetime = 100
|
-- o.updatetime = 100
|
||||||
vim.cmd([[highlight SpellBad cterm=undercurl ctermfg=Red]])
|
|
||||||
|
|
||||||
-- Folding
|
-- Folding
|
||||||
o.foldenable = false
|
o.foldenable = false
|
||||||
@ -140,7 +150,7 @@ o.showbreak= '↪' -- character to show when line is broken
|
|||||||
o.number = true -- line number on the left
|
o.number = true -- line number on the left
|
||||||
o.relativenumber = true
|
o.relativenumber = true
|
||||||
o.numberwidth = 3 -- always reserve 3 spaces for line number
|
o.numberwidth = 3 -- always reserve 3 spaces for line number
|
||||||
o.signcolumn = 'yes' -- keep 1 column for coc.vim check
|
o.signcolumn = 'yes'
|
||||||
o.modelines = 0
|
o.modelines = 0
|
||||||
|
|
||||||
-- Bottombar
|
-- Bottombar
|
||||||
@ -193,14 +203,29 @@ o.backup = true -- use backup files
|
|||||||
o.writebackup = false
|
o.writebackup = false
|
||||||
o.swapfile = false -- do not use swap file
|
o.swapfile = false -- do not use swap file
|
||||||
o.undofile = true
|
o.undofile = true
|
||||||
o.undodir = HOME .. '/.vim/dirs/undo//' -- undo files
|
o.undodir = HOME .. '/.local/share/nvim/dirs/undo//' -- undo files
|
||||||
o.backupdir = HOME .. '/.vim/dirs/backup//' -- backups
|
o.backupdir = HOME .. '/.local/share/nvim/dirs/backup//' -- backups
|
||||||
|
|
||||||
-- Commands mode
|
-- Commands mode
|
||||||
o.wildmenu = true -- on TAB, complete options for system command
|
o.wildmenu = true -- on TAB, complete options for system command
|
||||||
o.wildignore = 'deps,.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,.DS_Store,*.aux,*.out,*.toc'
|
o.wildignore = 'deps,.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,.DS_Store,*.aux,*.out,*.toc'
|
||||||
|
|
||||||
-- Mappings {{{
|
vim.cmd([[
|
||||||
|
au BufRead,BufNewFile *.md set ft=mkd tw=80 syntax=markdown
|
||||||
|
]])
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command('ReloadConfig', 'source $MYVIMRC', {})
|
||||||
|
|
||||||
|
local group = vim.api.nvim_create_augroup('user_cmds', {clear = true})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
|
desc = 'Highlight on yank',
|
||||||
|
group = group,
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank({higroup = 'Visual', timeout = 200})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
|
|
||||||
map({'n','v'}, '<Space>', "<Nop>", { silent = true })
|
map({'n','v'}, '<Space>', "<Nop>", { silent = true })
|
||||||
@ -235,10 +260,6 @@ map('n','<leader>q', '<cmd>bdelete<CR>', { silent = true })
|
|||||||
map('n','<S-Tab>', '<C-U>')
|
map('n','<S-Tab>', '<C-U>')
|
||||||
map('n','<Tab>', '<C-D>')
|
map('n','<Tab>', '<C-D>')
|
||||||
|
|
||||||
-- more natural movement with wrap on
|
|
||||||
map({'n','v'},'j', 'gj', { noremap = true, silent = true })
|
|
||||||
map({'n','v'},'k', 'gk', { noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- Easy buffer navigation
|
-- Easy buffer navigation
|
||||||
map('n','<C-h>', '<C-w>h', { silent = true })
|
map('n','<C-h>', '<C-w>h', { silent = true })
|
||||||
map('n','<C-j>', '<C-w>j', { silent = true })
|
map('n','<C-j>', '<C-w>j', { silent = true })
|
||||||
@ -249,9 +270,3 @@ map('n','<up>', '<cmd>resize -2<CR>', { silent = true })
|
|||||||
map('n','<down>', '<cmd>resize +2<CR>', { silent = true })
|
map('n','<down>', '<cmd>resize +2<CR>', { silent = true })
|
||||||
map('n','<left>', '<cmd>vertical resize -2<CR>', { silent = true })
|
map('n','<left>', '<cmd>vertical resize -2<CR>', { silent = true })
|
||||||
map('n','<right>', '<cmd>vertical resize +2<CR>', { silent = true })
|
map('n','<right>', '<cmd>vertical resize +2<CR>', { silent = true })
|
||||||
|
|
||||||
map({'n','i'},"<leader>s", "<cmd>HopChar2<cr>", { silent = true })
|
|
||||||
map('n',"<leader>w", "<cmd>HopWord<cr>", { silent = true })
|
|
||||||
|
|
||||||
map('n',"<silent><F6>", "<cmd>:set invspell<cr>", { silent = true })
|
|
||||||
--}}}
|
|
||||||
|
@ -38,11 +38,12 @@ export GPG_TTY=$TTY
|
|||||||
|
|
||||||
{{- if eq .chezmoi.os "openbsd" }}
|
{{- if eq .chezmoi.os "openbsd" }}
|
||||||
export PORTSDIR_PATH=/usr/ports/:/usr/ports/openbsd-wip
|
export PORTSDIR_PATH=/usr/ports/:/usr/ports/openbsd-wip
|
||||||
export PATH="$HOME/local/bin:$HOME/perl5/bin:$HOME/gems/bin:$HOME/.cargo/bin:$HOME/.yarn/bin:$PATH"
|
export PATH="$HOME/dev/src/ltex-ls-15.2.0/bin:$HOME/local/bin:$HOME/perl5/bin:$HOME/gems/bin:$HOME/.cargo/bin:$HOME/.yarn/bin:$PATH"
|
||||||
export PERL5LIB=$HOME/perl5/lib/perl5
|
export PERL5LIB=$HOME/perl5/lib/perl5
|
||||||
export PERL_LOCAL_LIB_ROOT=$HOME/perl5
|
export PERL_LOCAL_LIB_ROOT=$HOME/perl5
|
||||||
export PERL_MB_OPT='--install_base "/home/jan/perl5"'
|
export PERL_MB_OPT='--install_base "/home/jan/perl5"'
|
||||||
export PERL_MM_OPT='INSTALL_BASE=/home/jan/perl5'
|
export PERL_MM_OPT='INSTALL_BASE=/home/jan/perl5'
|
||||||
|
export JAVA_HOME=/usr/local/jdk-11/
|
||||||
export PMIX_MCA_gds='hash'
|
export PMIX_MCA_gds='hash'
|
||||||
|
|
||||||
alias top='htop'
|
alias top='htop'
|
||||||
|
Loading…
Reference in New Issue
Block a user