initial commit
parent
d708bfce70
commit
b272268f79
@ -0,0 +1,6 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup {}
|
||||
end,
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
return {
|
||||
"glepnir/lspsaga.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
vim.keymap.set('n', '<leader>k', ':Lspsaga hover_doc<CR>')
|
||||
vim.keymap.set('n', '<leader>gs', ':Lspsaga signature_help<CR>')
|
||||
vim.keymap.set('n', '<leader>rn', ':Lspsaga rename<CR>')
|
||||
vim.keymap.set('n', '<leader>ca', ':Lspsaga code_action<CR>')
|
||||
vim.keymap.set('n', '<leader>gl', ':Lspsaga show_line_diagnostics<CR>')
|
||||
vim.keymap.set('n', '<leader>gn', ':Lspsaga diagnostic_jump_next<CR>')
|
||||
vim.keymap.set('n', '<leader>gp', ':Lspsaga diagnostic_jump_prev<CR>')
|
||||
require("lspsaga").setup({})
|
||||
end,
|
||||
dependencies = {
|
||||
{"nvim-tree/nvim-web-devicons"},
|
||||
--Please make sure you install markdown and markdown_inline parser
|
||||
{"nvim-treesitter/nvim-treesitter"}
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
return {
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
dependencies = {"nvim-lua/plenary.nvim"},
|
||||
config = function ()
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
local formatting = null_ls.builtins.formatting
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
local codeActions = null_ls.builtins.code_actions
|
||||
|
||||
local sources = {
|
||||
formatting.eslint_d, formatting.prettierd.with({
|
||||
env = {
|
||||
PRETTIERD_DEFAULT_CONFIG = vim.fn.expand "~/.config/nvim/utils/linter-config/.prettierrc.js"
|
||||
}
|
||||
}), -- formatting.prettier
|
||||
-- .with({extra_args = {'--single-quote', '--tab-width 2', '--arrow-parens avoid'}}),
|
||||
formatting.lua_format.with({
|
||||
extra_args = {
|
||||
'--no-keep-simple-function-one-line', '--no-break-after-operator', '--column-limit=100',
|
||||
'--break-after-table-lb', '--indent-width=2'
|
||||
}
|
||||
}), diagnostics.eslint_d.with({diagnostics_format = "[#{c}] #{m} (#{s})"}), codeActions.eslint_d
|
||||
}
|
||||
|
||||
local lsp_formatting = function(bufnr)
|
||||
vim.lsp.buf.format({
|
||||
filter = function(client)
|
||||
-- apply whatever logic you want (in this example, we'll only use null-ls)
|
||||
return client.name == "null-ls"
|
||||
end,
|
||||
bufnr = bufnr
|
||||
})
|
||||
end
|
||||
|
||||
-- if you want to set up formatting on save, you can use this as a callback
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({group = augroup, buffer = bufnr})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
lsp_formatting(bufnr)
|
||||
end
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
null_ls.setup({sources = sources, debug = true, on_attach = on_attach})
|
||||
end
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
return {
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function ()
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
end
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
return {
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
config = function ()
|
||||
require'colorizer'.setup {
|
||||
'*', -- Highlight all files, but customize some others.
|
||||
css = {css = true} -- Enable parsing rgb(...) functions in css.
|
||||
}
|
||||
end
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
return {
|
||||
'petertriho/nvim-scrollbar',
|
||||
config = function ()
|
||||
require("scrollbar").setup({
|
||||
handle = {text = " "},
|
||||
marks = {
|
||||
Search = {text = {"-- ", "== "}},
|
||||
Error = {text = {" ", " "}},
|
||||
Warn = {text = {" ", " "}},
|
||||
Info = {text = {" ", " "}},
|
||||
Hint = {text = {" ", " "}},
|
||||
Misc = {text = {"-- ", "== "}}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
return {
|
||||
"kylechui/nvim-surround",
|
||||
config = function()
|
||||
require("nvim-surround").setup({})
|
||||
end
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
return {
|
||||
"ahmedkhalf/project.nvim",
|
||||
config = function()
|
||||
require("project_nvim").setup {}
|
||||
end
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
version = '*',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function ()
|
||||
-- Find files using lua fuctions
|
||||
local opts = { silent = true, noremap = true }
|
||||
vim.api.nvim_set_keymap('n', '<Leader>ff', "<Cmd>lua require'telescope.builtin'.find_files()<CR>", {silent=false, noremap=true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fg', "<Cmd>lua require'telescope.builtin'.live_grep()<CR>", opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fs', "<Cmd>lua require'telescope.builtin'.grep_string()<CR>", opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>ft', "<Cmd>lua require'telescope.builtin'.file_browser()<CR>", opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fo', "<Cmd>lua require'telescope.builtin'.oldfiles()<CR>", opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>gc', "<Cmd>lua require'telescope.builtin'.git_commits()<CR>", opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>gb', "<Cmd>lua require'telescope.builtin'.git_branches()<CR>", opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fb', "<Cmd>lua require'telescope.builtin'.buffers()<CR>", opts)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fh', "<Cmd>lua require'telescope.builtin'.help_tags()<CR>", opts)
|
||||
|
||||
local actions = require('telescope.actions')
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
-- program to use for searching with its arguments
|
||||
find_command = {'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case'},
|
||||
-- prompt_position = 'top', -- have prompt at the top (has no effect on vertical configuration)
|
||||
prompt_prefix = ' ', -- symbol on prompt window
|
||||
selection_caret = ' ', -- symbol on selected row in results window
|
||||
entry_prefix = ' ', -- symbol on non-selected rows in results window
|
||||
initial_mode = 'insert', -- start in insert mode
|
||||
selection_strategy = 'reset', -- what happens to selection when list changes
|
||||
sorting_strategy = 'ascending', -- start with most important search on top
|
||||
layout_strategy = 'horizontal', -- vertical layout
|
||||
layout_config = {
|
||||
prompt_position = 'top'
|
||||
},
|
||||
file_sorter = require'telescope.sorters'.get_fuzzy_file,
|
||||
file_ignore_patterns = {'node_modules/.*'}, -- never search in node_modules/ dir
|
||||
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
|
||||
display_path = true,
|
||||
winblend = 0, -- window should not be transparent
|
||||
border = {}, -- no border?
|
||||
borderchars = {'─', '│', '─', '│', '╭', '╮', '╯', '╰'}, -- border chars
|
||||
color_devicons = true, -- colorize used icons
|
||||
use_less = true, -- less is bash program for preview file contents
|
||||
set_env = {['COLORTERM'] = 'truecolor'}, -- use all the colors
|
||||
file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
|
||||
grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
|
||||
qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
|
||||
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker,
|
||||
-- preview_cutoff = 120,
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-j>'] = actions.move_selection_next,
|
||||
['<C-k>'] = actions.move_selection_previous,
|
||||
['<C-q>'] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
-- ['ć'] = actions.close,
|
||||
['<CR>'] = actions.select_default + actions.center,
|
||||
},
|
||||
n = {
|
||||
['<C-j>'] = actions.move_selection_next,
|
||||
['<C-k>'] = actions.move_selection_previous,
|
||||
['<C-q>'] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
['ć'] = actions.close,
|
||||
}
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
fzy_native = {
|
||||
override_generic_sorter = false,
|
||||
override_file_sorter = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
@ -0,0 +1 @@
|
||||
return {'mg979/vim-visual-multi'}
|
@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
trailingComma: 'none',
|
||||
tabWidth: 2,
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
printWidth: 80,
|
||||
arrowParens: 'avoid'
|
||||
};
|
Loading…
Reference in New Issue