feat: add spell check

This commit is contained in:
Fabio Lenherr / DashieTM 2022-10-13 01:41:22 +02:00
parent 2bed6f50c0
commit d42d294c95
122 changed files with 454 additions and 5657 deletions

View file

@ -1,2 +1,14 @@
vim.cmd('let g:vimtex_view_general_viewer = "evince"')
vim.cmd('let g:vimtex_compiler_method = "latexmk"')
vim.cmd("colorscheme nightfox")
vim.cmd([[highlight TabLineSel guifg=#192330 guibg=#192330]])
vim.cmd([[highlight BufferCurrent guifg=#FFFFFF guibg=#192330]])
vim.cmd([[highlight BufferCurrentIndex guifg=#FFFFFF guibg=#192330]])
vim.cmd([[highlight BufferCurrentMod guifg=#dbc074 guibg=#192330]])
vim.cmd([[highlight BufferCurrentSign guifg=#719cd6 guibg=#192330]])
vim.cmd([[highlight BufferCurrentTarget guifg=#c94f6d guibg=#192330]])
vim.cmd([[highlight BufferInactive guifg=#888888 guibg=#131a24]])
vim.cmd([[highlight BufferInactiveMod guifg=#dbc074 guibg=#131a24]])
vim.cmd([[highlight BufferInactiveSign guifg=#719cd6 guibg=#131a24]])

View file

@ -0,0 +1,44 @@
-- Set barbar's options
require("bufferline").setup({
animation = true,
auto_hide = false,
tabpages = true,
closable = true,
clickable = true,
exclude_ft = { "javascript" },
exclude_name = { "package.json" },
icons = true,
icon_custom_colors = false,
icon_separator_active = "",
icon_separator_inactive = "",
icon_close_tab = "",
icon_close_tab_modified = "",
icon_pinned = "",
insert_at_end = false,
maximum_padding = 1,
minimum_padding = 1,
maximum_length = 30,
semantic_letters = true,
letters = "asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP",
no_name_title = nil,
})
local nvim_tree_events = require("nvim-tree.events")
local bufferline_api = require("bufferline.api")
local function get_tree_size()
return require("nvim-tree.view").View.width
end
nvim_tree_events.subscribe("TreeOpen", function()
bufferline_api.set_offset(get_tree_size())
end)
nvim_tree_events.subscribe("Resize", function()
bufferline_api.set_offset(get_tree_size())
end)
nvim_tree_events.subscribe("TreeClose", function()
bufferline_api.set_offset(0)
end)

View file

@ -1,146 +0,0 @@
local status_ok, bufferline = pcall(require, "bufferline")
if not status_ok then
return
end
bufferline.setup {
options = {
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
-- NOTE: this plugin is designed with this icon in mind,
-- and so changing this is NOT recommended, this is intended
-- as an escape hatch for people who cannot bear it for whatever reason
indicator = {
style = 'icon',
},
buffer_close_icon = "",
-- buffer_close_icon = '',
modified_icon = "",
close_icon = "",
-- close_icon = '',
left_trunc_marker = "",
right_trunc_marker = "",
-- end,
max_name_length = 30,
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
tab_size = 21,
diagnostics = false, -- | "nvim_lsp" | "coc",
diagnostics_update_in_insert = false,
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = true,
show_tab_indicators = false,
persist_buffer_sort = true,-- whether or not custom sorted buffers should persist
-- can also be a table containing 2 custom separators
-- [focused and unfocused]. eg: { '|', '|' }
separator_style = "slant", -- | "thick" | "thin" | { 'any', 'any' },
enforce_regular_tabs = true,
always_show_bufferline = true,
hover = {
enabled = true,
delay = 200,
reveal = {'close'}
},
-- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b)
-- -- add custom logic
-- return buffer_a.modified > buffer_b.modified
-- end
},
highlights = {
fill = {
fg = { attribute = "fg", highlight = "#ff0000" },
bg = { attribute = "bg", highlight = "TabLine" },
},
background = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
-- buffer_selected = {
-- guifg = {attribute='fg',highlight='#ff0000'},
-- guibg = {attribute='bg',highlight='#0000ff'},
-- gui = 'none'
-- },
buffer_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
close_button = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
close_button_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
-- close_button_selected = {
-- guifg = {attribute='fg',highlight='TabLineSel'},
-- guibg ={attribute='bg',highlight='TabLineSel'}
-- },
tab_selected = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
tab = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
tab_close = {
-- guifg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
fg = { attribute = "fg", highlight = "TabLineSel" },
bg = { attribute = "bg", highlight = "Normal" },
},
duplicate_selected = {
fg = { attribute = "fg", highlight = "TabLineSel" },
bg = { attribute = "bg", highlight = "TabLineSel" },
italic = true,
},
duplicate_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
italic = true,
},
duplicate = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
italic = true,
},
modified = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
modified_selected = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
modified_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
separator = {
fg = { attribute = "bg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
separator_selected = {
fg = { attribute = "bg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
separator_visible = {
fg = {attribute='bg',highlight='TabLine'},
bg = {attribute='bg',highlight='TabLine'}
},
indicator_selected = {
fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
bg = { attribute = "bg", highlight = "Normal" },
},
},
}

View file

@ -1,11 +1,11 @@
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
return
end
local snip_status_ok, luasnip = pcall(require, "luasnip")
if not snip_status_ok then
return
return
end
vim.cmd('let g:snipMate = {"snippet_version" : 1 }')
@ -13,121 +13,130 @@ require("luasnip/loaders/from_vscode").lazy_load()
require("luasnip.loaders.from_snipmate").lazy_load()
local check_backspace = function()
local col = vim.fn.col "." - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
local col = vim.fn.col(".") - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
end
--   פּ ﯟ   some other good icons
local kind_icons = {
Text = "",
Method = "m",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
Text = "",
Method = "m",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
}
-- find more here: https://www.nerdfonts.com/cheat-sheet
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body) -- For `luasnip` users.
end,
},
mapping = {
["<C-k>"] = cmp.mapping.select_prev_item(),
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body) -- For `luasnip` users.
end,
},
mapping = {
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
["<C-e>"] = cmp.mapping {
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
},
-- Accept currently selected item. If none selected, `select` first item.
-- Set `select` to `false` to only confirm explicitly selected items.
["<CR>"] = cmp.mapping.confirm { select = true },
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
fallback()
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",
}),
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
-- Kind icons
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
vim_item.menu = ({
nvim_lsp = "[LSP]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
})[entry.source.name]
return vim_item
end,
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
},
confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
window = {
documentation = {
border = { "", "", "", "", "", "", "", "" },
},
},
experimental = {
ghost_text = false,
native_menu = false,
},
}
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
["<C-e>"] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
}),
-- Accept currently selected item. If none selected, `select` first item.
-- Set `select` to `false` to only confirm explicitly selected items.
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
fallback()
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",
}),
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
-- Kind icons
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
vim_item.menu = ({
nvim_lsp = "[LSP]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
})[entry.source.name]
return vim_item
end,
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
{
name = "spell",
option = {
keep_all_entries = false,
enable_in_context = function()
return true
end,
},
},
},
confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
window = {
documentation = {
border = { "", "", "", "", "", "", "", "" },
},
},
experimental = {
ghost_text = false,
native_menu = false,
},
})

View file

@ -1,6 +0,0 @@
local status_ok, _ = pcall(require, "nightfox")
if not status_ok then
return
end
vim.cmd("colorscheme nightfox")

View file

@ -20,3 +20,5 @@ comment.setup {
}
end,
}
vim.cmd([[highlight TabLineSel guifg=#192330 guibg=112e54]])
vim.cmd([[highlight BufferDefaultCurrent guifg=#192330 guibg=112e54]])

View file

@ -1,45 +0,0 @@
local dap = require('dap')
dap.adapters.cppdbg = {
id = 'cppdbg',
type = 'executable',
command = '/home/dashie/.config/nvim/plugged/cpptools/extension/debugAdapters/bin/OpenDebugAD7',
}
dap.configurations.cpp = {
{
name = "Launch file",
type = "cppdbg",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file')
end,
cwd = '${workspaceFolder}',
stopAtEntry = true,
},
{
name = "Launch file --gui",
type = "cppdbg",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file')
end,
args = {'--gui'},
cwd = '${workspaceFolder}',
stopAtEntry = true,
},
{
name = 'Attach to gdbserver :1234',
type = 'cppdbg',
request = 'launch',
MIMode = 'gdb',
miDebuggerServerAddress = 'localhost:1234',
miDebuggerPath = '/usr/bin/gdb',
cwd = '${workspaceFolder}',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file')
end,
},
}
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp

View file

@ -1,73 +0,0 @@
require("dapui").setup({
icons = { expanded = "", collapsed = "", current_frame = "" },
mappings = {
-- Use a table to apply multiple mappings
expand = { "<CR>", "<2-LeftMouse>" },
open = "o",
remove = "d",
edit = "e",
repl = "r",
toggle = "t",
},
-- Expand lines larger than the window
-- Requires >= 0.7
expand_lines = vim.fn.has("nvim-0.7") == 1,
-- Layouts define sections of the screen to place windows.
-- The position can be "left", "right", "top" or "bottom".
-- The size specifies the height/width depending on position. It can be an Int
-- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
-- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
-- Elements are the elements shown in the layout (in order).
-- Layouts are opened in order so that earlier layouts take priority in window sizing.
layouts = {
{
elements = {
-- Elements can be strings or table with id and size keys.
{ id = "scopes", size = 0.25 },
"breakpoints",
"stacks",
"watches",
},
size = 40, -- 40 columns
position = "left",
},
{
elements = {
"repl",
"console",
},
size = 0.25, -- 25% of total lines
position = "bottom",
},
},
controls = {
-- Requires Neovim nightly (or 0.8 when released)
enabled = true,
-- Display controls in this element
element = "repl",
icons = {
pause = "",
play = "",
step_into = "",
step_over = "",
step_out = "",
step_back = "",
run_last = "",
terminate = "",
},
},
floating = {
max_height = nil, -- These can be integers or a float between 0 and 1.
max_width = nil, -- Floats will be treated as percentage of your screen.
border = "single", -- Border style. Can be "single", "double" or "rounded"
mappings = {
close = { "q", "<Esc>" },
},
},
windows = { indent = 1 },
render = {
max_type_length = nil, -- Can be integer or nil.
max_value_lines = 100, -- Can be integer or nil.
}
})
require("dapui").setup()

View file

@ -3,7 +3,6 @@ if not status_ok then
return
end
require'nvim-web-devicons'.setup {
-- your personnal icons can go here (to override)
-- you can specify color or cterm_color instead of specifying both of them

View file

@ -1,8 +0,0 @@
local status_ok, _ = pcall(require, "feline")
if not status_ok then
return
end
require('feline').setup()
--require('feline').winbar.setup()

View file

@ -1 +0,0 @@
require('gitsigns').setup()

View file

@ -1,6 +0,0 @@
local status_ok, impatient = pcall(require, "impatient")
if not status_ok then
return
end
impatient.enable_profile()

View file

@ -58,10 +58,10 @@ vim.wo.colorcolumn = "99999"
-- vim.opt.listchars:append "eol:↴"
indent_blankline.setup({
-- show_end_of_line = true,
-- space_char_blankline = " ",
show_end_of_line = true,
space_char_blankline = " ",
show_current_context = true,
-- show_current_context_start = true,
show_current_context_start = true,
-- char_highlight_list = {
-- "IndentBlanklineIndent1",
-- "IndentBlanklineIndent2",

View file

@ -5,7 +5,6 @@ local term_opts = { silent = true }
-- Shorten function name
local keymap = vim.api.nvim_set_keymap
keymap("n", "c", ":CodeActionMenu<CR>", opts)
keymap("n", "<F5>", ':lua require("dap").toggle_breakpoint()<CR>', opts)
keymap("n", "<F6>", ':lua require("dap").step_over()<CR>', opts)
@ -17,7 +16,13 @@ keymap("n", "<F10>", ':lua require("dap").continue()<CR> :lua require("dapui").t
keymap("n", "t", ':lua require("nvim-tree").toggle()<CR>', opts)
keymap("n", "f", ':lua require("nvim-tree").focus()<CR>', opts)
keymap("n", "<F1>", ':BufferLineMoveNext<CR>', opts)
keymap("n", "<F2>", ':BufferLineMovePrev<CR>', opts)
keymap("n", "<F1>", ":BufferPrev<CR>", opts)
keymap("n", "<F2>", ":BufferNext<CR>", opts)
keymap("n", "<F4>", ':lua vim.lsp.buf.format { async = true }<CR>', opts)
keymap("n", "<F4>", ":lua vim.lsp.buf.format { async = true }<CR>", opts)
local builtin = require("telescope.builtin")
vim.keymap.set("n", "ff", builtin.find_files, {})
vim.keymap.set("n", "fg", builtin.live_grep, {})
vim.keymap.set("n", "fb", builtin.buffers, {})
vim.keymap.set("n", "fh", builtin.help_tags, {})

View file

@ -1,4 +0,0 @@
require('lint').linters_by_ft = {
javascript = {'eslint',},
react = {'eslint',},
}

View file

@ -4,114 +4,112 @@ if not status_ok then
end
require("mason").setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
})
require("mason-lspconfig").setup({
ensure_installed = {
"cssls", -- css
"html", -- html
"eslint", -- latex
"clangd", -- cpp / c
"tsserver", -- python
"texlab", -- latex
"sumneko_lua", -- lua
"pyright", -- python
"rust_analyzer", -- rust
"jdtls", -- jdtls
"cmake", -- cmake
"bashls", -- shell
"ansiblels", -- ansible
"csharp_ls", -- dotnot
"hls" -- haskel
},
automatic_installation = true
ensure_installed = {
"cssls", -- css
"html", -- html
"eslint", -- latex
"clangd", -- cpp / c
"tsserver", -- python
"texlab", -- latex
"sumneko_lua", -- lua
"pyright", -- python
"rust_analyzer", -- rust
"jdtls", -- jdtls
"cmake", -- cmake
"bashls", -- shell
"ansiblels", -- ansible
"csharp_ls", -- dotnot
"hls", -- haskel
},
automatic_installation = true,
})
require('lspconfig')['cssls'].setup{
capabilities = capabilities,
on_attach = on_attach
}
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
require('lspconfig')['html'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["cssls"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require('lspconfig')['eslint'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["html"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require('lspconfig')['clangd'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["eslint"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require('lspconfig')['tsserver'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["clangd"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require('lspconfig')['texlab'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["tsserver"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require('lspconfig')['sumneko_lua'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["texlab"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require('lspconfig')['pyright'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["sumneko_lua"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require('lspconfig')['rust_analyzer'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["pyright"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require('lspconfig')['jdtls'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["rust_analyzer"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require('lspconfig')['cmake'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["jdtls"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require('lspconfig')['bashls'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require('lspconfig')['ansiblels'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require('lspconfig')['csharp_ls'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require('lspconfig')['hls'].setup{
capabilities = capabilities,
on_attach = on_attach
}
require("lspconfig")["cmake"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require("lspconfig")["bashls"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require("lspconfig")["ansiblels"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require("lspconfig")["csharp_ls"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
require("lspconfig")["hls"].setup({
capabilities = capabilities,
--on_attach = on_attach,
})
--local status_ok2, lsp_installer = pcall(require, "mason")
--if not status_ok2 then

View file

@ -1,14 +0,0 @@
local M = {}
local lsp_util = vim.lsp.util
function M.code_action_listener()
local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() }
local params = lsp_util.make_range_params()
params.context = context
vim.lsp.buf_request(0, 'textDocument/codeAction', params, function(err, _, result)
-- do something with result - e.g. check if empty and show some indication such as a sign
end)
end
return M

View file

@ -11,25 +11,17 @@ require("mason-null-ls").setup({
"autopep8",
"stylua",
"rustfmt",
"stylish-haskell",
"stylish-haskell",
},
})
null_ls.setup({
on_attach = function(client, bufnr)
if client.server_capabilities.documentFormattingProvider then
vim.cmd("nnoremap <silent><buffer> <Leader>f :lua vim.lsp.buf.format { async = true }<CR>")
-- format on save
vim.cmd("autocmd BufWritePost <buffer> lua vim.lsp.buf.format { async = true }")
end
if client.server_capabilities.documentRangeFormattingProvider then
vim.cmd("xnoremap <silent><buffer> <Leader>f :lua vim.lsp.buf.range_formatting({})<CR>")
end
end,
sources = {
require("null-ls").builtins.completion.spell,
require("null-ls").builtins.formatting.prettier,
require("null-ls").builtins.formatting.clang_format,
require("null-ls").builtins.formatting.latexindent,

View file

@ -11,18 +11,6 @@ if not config_status_ok then
return
end
-- Replaces auto_close
--local tree_cb = nvim_tree_config.nvim_tree_callback
--vim.api.nvim_create_autocmd("BufEnter", {
-- nested = true,
-- callback = function()
-- if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then
-- vim.cmd "quit"
-- end
-- end
--})
nvim_tree.setup { -- BEGIN_DEFAULT_OPTS
auto_reload_on_write = true,
create_in_closed_folder = false,
@ -47,7 +35,6 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS
adaptive_size = false,
centralize_selection = false,
width = 30,
height = 30,
hide_root_folder = false,
side = "left",
preserve_window_proportions = false,
@ -58,7 +45,7 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS
mappings = {
custom_only = false,
list = {
-- user mappings go here
-- user mappings go here
},
},
float = {
@ -136,7 +123,7 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS
auto_open = true,
},
update_focused_file = {
enable = false,
enable = true,
update_root = false,
ignore_list = {},
},
@ -231,4 +218,24 @@ nvim_tree.setup { -- BEGIN_DEFAULT_OPTS
},
}
vim.g.nvim_tree_group_empty = 1
-- nvim-tree is also there in modified buffers so this function filter it out
local modifiedBufs = function(bufs)
local t = 0
for k,v in pairs(bufs) do
if v.name:match("NvimTree_") == nil then
t = t + 1
end
end
return t
end
vim.api.nvim_create_autocmd("BufEnter", {
nested = true,
callback = function()
if #vim.api.nvim_list_wins() == 1 and
vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil and
modifiedBufs(vim.fn.getbufinfo({bufmodified = 1})) == 0 then
vim.cmd "quit"
end
end
})

View file

@ -7,21 +7,21 @@ local options = {
smartcase = true,
showmode = true,
termguicolors = true,
-- winbar = "",
-- winbar = "",
ignorecase = true,
showtabline = 2,
timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undoi updatetime = 300, -- faster completion (4000ms default)
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
expandtab = true, -- convert tabs to spaces
shiftwidth = 2, -- the number of spaces inserted for each indentation
tabstop = 2, -- insert 2 spaces for a tab
cursorline = true,
scrolloff = 8, -- is one of my fav
sidescrolloff = 8,
spell = true,
spelllang = "en_us",
mousemodel = "popup_setpos",
timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undoi updatetime = 300, -- faster completion (4000ms default)
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
expandtab = true, -- convert tabs to spaces
shiftwidth = 2, -- the number of spaces inserted for each indentation
tabstop = 2, -- insert 2 spaces for a tab
cursorline = true,
scrolloff = 8, -- is one of my fav
sidescrolloff = 8,
spell = true,
spelllang = "en_us",
mousemodel = "popup_setpos",
}
--vim.opt.shortmess:append "c"
@ -29,5 +29,3 @@ local options = {
for k, v in pairs(options) do
vim.opt[k] = v
end

View file

@ -1,33 +1,36 @@
-- Setup nvim-cmp.
local status_ok, npairs = pcall(require, "nvim-autopairs")
if not status_ok then
return
return
end
local Rule = require('nvim-autopairs.rule')
npairs.setup {
check_ts = true,
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
java = false,
},
disable_filetype = { "TelescopePrompt", "spectre_panel" },
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", '"', "'" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
offset = 0, -- Offset from pattern match
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
check_comma = true,
highlight = "PmenuSel",
highlight_grey = "LineNr",
},
}
npairs.setup({
check_ts = true,
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
java = false,
},
disable_filetype = { "TelescopePrompt", "spectre_panel" },
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", "<", '"', "'"},
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
offset = 0, -- Offset from pattern match
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
check_comma = true,
highlight = "PmenuSel",
highlight_grey = "LineNr",
},
})
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
npairs.add_rule(Rule("<",">"))
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
return
end
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } })
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))

View file

@ -1,54 +1,54 @@
local Plug = vim.fn['plug#']
vim.call('plug#begin', '~/.config/nvim/plugged')
Plug 'folke/twilight.nvim'
Plug 'nvim-lua/popup.nvim' -- An implementation of the Popup API from vim in Neovim
Plug 'nvim-lua/plenary.nvim' -- Useful lua functions used ny lots of plugins
Plug 'EdenEast/nightfox.nvim'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'feline-nvim/feline.nvim'
Plug 'lewis6991/gitsigns.nvim'
Plug 'tanvirtin/vgit.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'b3nj5m1n/kommentary'
Plug 'antoinemadec/FixCursorHold.nvim'
Plug 'lambdalisue/fern.vim'
Plug "williamboman/mason.nvim"
Plug "williamboman/mason-lspconfig.nvim"
Plug 'neovim/nvim-lspconfig'
Plug 'jose-elias-alvarez/null-ls.nvim'
Plug 'jayp0521/mason-null-ls.nvim'
Plug 'mfussenegger/nvim-dap'
Plug 'rcarriga/nvim-dap-ui'
Plug 'theHamsta/nvim-dap-virtual-text'
Plug 'jayp0521/mason-nvim-dap.nvim'
Plug('nvim-treesitter/nvim-treesitter', { ['do'] = vim.fn[':TSUpdate'] })
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'saadparwaiz1/cmp_luasnip'
Plug 'L3MON4D3/LuaSnip'
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'tomtom/tlib_vim'
Plug 'garbas/vim-snipmate'
Plug 'kyazdani42/nvim-tree.lua'
Plug 'windwp/nvim-autopairs'
Plug 'akinsho/bufferline.nvim'
Plug 'numToStr/Comment.nvim'
Plug 'lukas-reineke/indent-blankline.nvim'
Plug 'lewis6991/impatient.nvim'
Plug 'lewis6991/spellsitter.nvim'
Plug 'moll/vim-bbye'
Plug 'nvim-telescope/telescope.nvim'
Plug 'ahmedkhalf/project.nvim'
Plug 'goolord/alpha-nvim'
Plug 'lervag/vimtex'
Plug 'weilbith/nvim-code-action-menu'
Plug 'MunifTanjim/prettier.nvim'
Plug 'rafamadriz/friendly-snippets'
Plug 'p00f/nvim-ts-rainbow'
Plug 'nvim-telescope/telescope-ui-select.nvim'
Plug 'nvim-telescope/telescope-file-browser.nvim'
Plug 'nvim-telescope/telescope-fzy-native.nvim'
vim.call('plug#end')
local Plug = vim.fn["plug#"]
vim.call("plug#begin", "~/.config/nvim/plugged")
Plug("folke/twilight.nvim")
Plug("nvim-lua/popup.nvim") -- An implementation of the Popup API from vim in Neovim
Plug("nvim-lua/plenary.nvim") -- Useful lua functions used ny lots of plugins
Plug("EdenEast/nightfox.nvim")
Plug("kyazdani42/nvim-web-devicons")
Plug("feline-nvim/feline.nvim")
Plug("lewis6991/gitsigns.nvim")
Plug("tanvirtin/vgit.nvim")
Plug("nvim-lua/plenary.nvim")
Plug("b3nj5m1n/kommentary")
Plug("antoinemadec/FixCursorHold.nvim")
Plug("lambdalisue/fern.vim")
Plug("williamboman/mason.nvim")
Plug("williamboman/mason-lspconfig.nvim")
Plug("neovim/nvim-lspconfig")
Plug("jose-elias-alvarez/null-ls.nvim")
Plug("jayp0521/mason-null-ls.nvim")
Plug("mfussenegger/nvim-dap")
Plug("rcarriga/nvim-dap-ui")
Plug("theHamsta/nvim-dap-virtual-text")
Plug("jayp0521/mason-nvim-dap.nvim")
Plug("nvim-treesitter/nvim-treesitter", { ["do"] = vim.fn[":TSUpdate"] })
Plug("hrsh7th/nvim-cmp")
Plug("hrsh7th/cmp-nvim-lsp")
Plug("hrsh7th/cmp-buffer")
Plug("hrsh7th/cmp-path")
Plug("hrsh7th/cmp-cmdline")
Plug("f3fora/cmp-spell")
Plug("saadparwaiz1/cmp_luasnip")
Plug("L3MON4D3/LuaSnip")
Plug("MarcWeber/vim-addon-mw-utils")
Plug("tomtom/tlib_vim")
Plug("garbas/vim-snipmate")
Plug("kyazdani42/nvim-tree.lua")
Plug("windwp/nvim-autopairs")
Plug("romgrk/barbar.nvim")
Plug("numToStr/Comment.nvim")
Plug("lukas-reineke/indent-blankline.nvim")
Plug("lewis6991/impatient.nvim")
Plug("lewis6991/spellsitter.nvim")
Plug("moll/vim-bbye")
Plug("nvim-telescope/telescope.nvim")
Plug("ahmedkhalf/project.nvim")
Plug("goolord/alpha-nvim")
Plug("lervag/vimtex")
Plug("weilbith/nvim-code-action-menu")
Plug("rafamadriz/friendly-snippets")
Plug("p00f/nvim-ts-rainbow")
Plug("nvim-telescope/telescope-ui-select.nvim")
Plug("nvim-telescope/telescope-file-browser.nvim")
Plug("nvim-telescope/telescope-fzy-native.nvim")
vim.call("plug#end")

View file

@ -1,19 +0,0 @@
local prettier = require("prettier")
prettier.setup({
bin = 'prettier', -- or `prettierd`
filetypes = {
"css",
"graphql",
"html",
"javascript",
"javascriptreact",
"json",
"less",
"markdown",
"scss",
"typescript",
"typescriptreact",
"yaml",
},
})

View file

@ -3,41 +3,15 @@ if not status_ok then
return
end
project.setup({
---@usage set to false to disable project.nvim.
--- This is on by default since it's currently the expected behavior.
active = true,
on_config_done = nil,
---@usage set to true to disable setting the current-woriking directory
--- Manual mode doesn't automatically change your root directory, so you have
--- the option to manually do so using `:ProjectRoot` command.
manual_mode = false,
---@usage Methods of detecting the root directory
--- Allowed values: **"lsp"** uses the native neovim lsp
--- **"pattern"** uses vim-rooter like glob pattern matching. Here
--- order matters: if one is not detected, the other is used as fallback. You
--- can also delete or rearangne the detection methods.
-- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project
detection_methods = { "pattern" },
---@usage patterns used to detect root dir, when **"pattern"** is in detection_methods
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" },
---@ Show hidden files in telescope when searching for files in a project
show_hidden = false,
---@usage When set to false, you will get a message when project.nvim changes your directory.
-- When set to false, you will get a message when project.nvim changes your directory.
silent_chdir = true,
---@usage list of lsp client names to ignore when using **lsp** detection. eg: { "efm", ... }
ignore_lsp = {},
---@type string
---@usage path to store the project history for use in telescope
datapath = vim.fn.stdpath("data"),
datapath = vim.fn.stdpath("data"),
})
local tele_status_ok, telescope = pcall(require, "telescope")
@ -45,4 +19,4 @@ if not tele_status_ok then
return
end
telescope.load_extension('projects')
telescope.load_extension("projects")

View file

@ -1,14 +1,9 @@
require("nvim-treesitter.configs").setup {
highlight = {
-- ...
},
-- ...
rainbow = {
enable = true,
-- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
max_file_lines = nil, -- Do not enable for files with more than n lines, int
-- colors = {}, -- table of hex strings
-- termcolors = {} -- table of colour name strings
extended_mode = true,
max_file_lines = nil,
}
}

View file

@ -1,8 +0,0 @@
local builtin = require('telescope.builtin')
local async = require "plenary.async"
require('telescope').setup{}
require('telescope').load_extension('fzy_native')
vim.keymap.set('n', 'ff', builtin.find_files, {})
vim.keymap.set('n', 'fg', builtin.live_grep, {})
vim.keymap.set('n', 'fb', builtin.buffers, {})
vim.keymap.set('n', 'fh', builtin.help_tags, {})

View file

@ -3,19 +3,18 @@ if not status_ok then
return
end
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all"
ensure_installed = { "latex" , "c", "cpp" , "rust" , "lua", "haskell" , "java" , "javascript" , "typescript" },
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}
require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all"
ensure_installed = { "latex", "c", "cpp", "rust", "lua", "haskell", "java", "javascript", "typescript" },
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
})
local status_ok2, _ = pcall(require, "spellsitter")
if not status_ok2 then
return
return
end
require("spellsitter").setup()

View file

@ -1,24 +0,0 @@
--vim.cmd('let g:vimtex_view_method = "zathura"')
vim.cmd('let g:vimtex_view_general_viewer = "evince"')
--let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
--vim.cmd('let g:vimtex_compiler_latexmk = { "options" : [ "-shell-escape", "-interaction=nonstopmode" , "-synctex=1" ], }')
vim.cmd('let g:vimtex_compiler_method = "latexmk"')
--vim.cmd('let b:tex_use_shell_escape = 1')
--let maplocalleader = ","
--let g:vimtex_compiler_latexmk = {
-- \ 'options' : [
-- \ '-pdf',
-- \ '-shell-escape',
-- \ '-verbose',
-- \ '-file-line-error',
-- \ '-synctex=1',
-- \ '-interaction=nonstopmode',
-- \ ],
-- \}