changes, idk

This commit is contained in:
2022-05-18 06:15:59 -05:00
parent 2420aee32b
commit 39cd83f557
21 changed files with 680 additions and 662 deletions
-3
View File
@@ -1,3 +0,0 @@
--vim.o.foldlevelstart = 4
--vim.o.foldmethod = "expr"
--vim.o.foldexpr = "nvim_treesitter#foldexpr()"
+3
View File
@@ -0,0 +1,3 @@
vim.o.foldlevelstart = 10
vim.o.foldmethod = "expr"
vim.o.foldexpr = "nvim_treesitter#foldexpr()"
+2
View File
@@ -0,0 +1,2 @@
vim.bo.shiftwidth = 2
vim.bo.tabstop = 2
+1 -1
View File
@@ -1,3 +1,3 @@
local len = 4 local len = 2
vim.bo.shiftwidth = len vim.bo.shiftwidth = len
vim.bo.tabstop = len vim.bo.tabstop = len
+3
View File
@@ -0,0 +1,3 @@
local len = 2
vim.bo.shiftwidth = len
vim.bo.tabstop = len
+3
View File
@@ -0,0 +1,3 @@
local len = 2
vim.bo.shiftwidth = len
vim.bo.tabstop = len
+3
View File
@@ -0,0 +1,3 @@
local len = 2
vim.bo.shiftwidth = len
vim.bo.tabstop = len
+6 -6
View File
@@ -1,13 +1,13 @@
local function local_map(mode, lhs, rhs, opts) local function local_map(mode, lhs, rhs, opts)
local options = {noremap = true} local options = { noremap = true }
if opts then if opts then
options = vim.tbl_extend("force", options, opts) options = vim.tbl_extend("force", options, opts)
end end
vim.api.nvim_buf_set_keymap(0, mode, lhs, rhs, options) vim.api.nvim_buf_set_keymap(0, mode, lhs, rhs, options)
end end
local function silent_map(mode, lhs, rhs) local function silent_map(mode, lhs, rhs)
local_map(mode, lhs, rhs, {silent = true}) local_map(mode, lhs, rhs, { silent = true })
end end
silent_map("n", "<Up>", "gk") silent_map("n", "<Up>", "gk")
+3
View File
@@ -0,0 +1,3 @@
local len = 2
vim.bo.shiftwidth = len
vim.bo.tabstop = len
+3
View File
@@ -0,0 +1,3 @@
local len = 2
vim.bo.shiftwidth = len
vim.bo.tabstop = len
+3
View File
@@ -0,0 +1,3 @@
local len = 2
vim.bo.shiftwidth = len
vim.bo.tabstop = len
+7 -7
View File
@@ -1,10 +1,10 @@
require "ale" --require("ale")
require "packer_check" require("packer_check")
require "plugins" require("plugins")
require "config" require("config")
require "keybinds" require("keybinds")
require "save_buffer_position" require("save_buffer_position")
require "lsp" require("lsp")
--local theme = vim.env.LIGHTMODE == "1" and "onehalflight" or "onedark" --local theme = vim.env.LIGHTMODE == "1" and "onehalflight" or "onedark"
--vim.cmd("colorscheme " .. theme) --vim.cmd("colorscheme " .. theme)
+19 -18
View File
@@ -6,27 +6,28 @@ g.ale_linters_explicit = true
g.ale_fix_on_save = false g.ale_fix_on_save = false
g.ale_fixers = { g.ale_fixers = {
--c = {"clang-format"}, --c = {"clang-format"},
cpp = {"clang-format"}, cpp = { "clang-format" },
sh = {"shfmt"}, sh = { "shfmt" },
python = {"isort", "black"}, python = { "isort", "black" },
lua = {"luafmt"}, lua = { "luafmt" },
json = {"prettier"}, json = { "prettier" },
css = {"prettier"}, css = { "prettier" },
scss = {"prettier"}, scss = { "prettier" },
html = {"prettier"}, html = { "prettier" },
javascript = {"prettier"}, javascript = { "prettier" },
typescript = {"prettier"}, typescript = { "prettier" },
javascriptreact = {"prettier"}, javascriptreact = { "prettier" },
typescriptreact = {"prettier"} typescriptreact = { "prettier" },
htmldjango = { "prettier" },
} }
g.ale_linters = { g.ale_linters = {
sh = {"bashate"} sh = { "bashate" },
--python = {"flake8"}, --python = {"flake8"},
--cpp = {"g++"}, --cpp = {"g++"},
--html = {"tidy"}, --html = {"tidy"},
--css = {"stylelint"} --css = {"stylelint"}
} }
g.ale_lint_on_text_changed = "normal" g.ale_lint_on_text_changed = "normal"
+119 -107
View File
@@ -1,7 +1,10 @@
-- env file highlighting -- env file highlighting
vim.cmd [[au BufRead,BufNewFile .env.* set filetype=sh]] vim.cmd([[au BufRead,BufNewFile .env.* set filetype=sh]])
-- Dockerfile file highlighting -- Dockerfile file highlighting
vim.cmd [[au BufRead,BufNewFile Dockerfile.* set filetype=dockerfile]] vim.cmd([[au BufRead,BufNewFile Dockerfile.* set filetype=dockerfile]])
vim.cmd([[au BufWrite * normal zx]])
-- jinja highlighting
vim.cmd([[au BufRead,BufNewFile *.jinja set filetype=html]])
local opt = vim.opt -- to set options local opt = vim.opt -- to set options
local fn = vim.fn local fn = vim.fn
@@ -56,7 +59,7 @@ opt.foldmethod = "indent"
----------------------------------------------------- -----------------------------------------------------
-- DISABLE HIGHLIGHT OUTSIDE OF SEARCH AND REPLACE -- -- DISABLE HIGHLIGHT OUTSIDE OF SEARCH AND REPLACE --
----------------------------------------------------- -----------------------------------------------------
vim.cmd [[ vim.cmd([[
" Enable highlighting all the matches in incsearch mode " Enable highlighting all the matches in incsearch mode
" But don't enable hlsearch always " But don't enable hlsearch always
augroup vimrc-incsearch-highlight augroup vimrc-incsearch-highlight
@@ -64,12 +67,17 @@ augroup vimrc-incsearch-highlight
autocmd CmdlineEnter [/\?:] :set hlsearch autocmd CmdlineEnter [/\?:] :set hlsearch
autocmd CmdlineLeave [/\?:] :set nohlsearch autocmd CmdlineLeave [/\?:] :set nohlsearch
augroup END augroup END
]] ]])
--------------- ---------------
-- PROVIDERS -- -- PROVIDERS --
--------------- ---------------
g.python3_host_prog = "/usr/bin/python3" local pyenv_root = vim.env.PYENV_ROOT
if pyenv_root ~= nil then
g.python3_host_prog = pyenv_root .. '/shims/python3'
else
g.python3_host_prog = "/usr/bin/python3"
end
------------------ ------------------
-- ONEDARK.NVIM -- -- ONEDARK.NVIM --
@@ -80,10 +88,10 @@ g.python3_host_prog = "/usr/bin/python3"
--g.onedark_darker_diagnostics = false --g.onedark_darker_diagnostics = false
-- Lua -- Lua
require("onedark").setup { require("onedark").setup({
style = "darker", style = "darker",
toggle_style_key = "<nop>" toggle_style_key = "<nop>",
} })
require("onedark").load() require("onedark").load()
---------------- ----------------
@@ -100,13 +108,13 @@ g.bracey_refresh_on_save = true
----------------------- -----------------------
-- TREESITTER CONFIG -- -- TREESITTER CONFIG --
----------------------- -----------------------
require("nvim-treesitter.configs").setup { require("nvim-treesitter.configs").setup({
ensure_installed = "maintained", ensure_installed = "all",
highlight = { highlight = {
enable = true, enable = true,
disable = {"typescript", "tsx", "html", "javascript"} disable = { "typescript", "tsx", "html", "javascript" },
} },
} })
----------------------- -----------------------
-- GITHUB NVIM THEME -- -- GITHUB NVIM THEME --
@@ -123,79 +131,81 @@ g.github_hide_inactive_statusline = false
-- LUALINE -- -- LUALINE --
------------- -------------
require("lualine").setup { require("lualine").setup({
options = {theme = "onedark", icons_enabled = true}, options = { theme = "onedark", icons_enabled = true },
sections = { sections = {
lualine_a = {"mode"}, lualine_a = { "mode" },
lualine_b = { lualine_b = {
"FugitiveHead" "FugitiveHead",
}, },
lualine_c = {"filename"}, lualine_c = { "filename" },
lualine_x = { lualine_x = {
"encoding", "encoding",
"fileformat", "fileformat",
"filetype", "filetype",
[[string.format("%d Lines", vim.fn.line('$'))]], [[string.format("%d Lines", vim.fn.line('$'))]],
{ {
"diagnostics", "diagnostics",
sources = {"nvim_diagnostic", "ale"} sources = { "nvim_diagnostic", "ale" },
} },
}, },
lualine_y = { lualine_y = {
"progress" "progress",
}, },
lualine_z = {"location"} lualine_z = { "location" },
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = {"filename"}, lualine_c = { "filename" },
lualine_x = {"location"}, lualine_x = { "location" },
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {},
}, },
tabline = { tabline = {
lualine_a = { lualine_a = {
{ {
"buffers", "buffers",
show_filename_only = false, -- shows shortened relative path when false show_filename_only = false, -- shows shortened relative path when false
show_modified_status = true, -- shows indicator then bufder is modified show_modified_status = true, -- shows indicator then bufder is modified
max_length = vim.o.columns * 5 / 7, -- maximum width of buffers component max_length = function ()
filetype_names = { return vim.o.columns * 5 / 6
TelescopePrompt = "Telescope", end, -- maximum width of buffers component
dashboard = "Dashboard", filetype_names = {
packer = "Packer", TelescopePrompt = "Telescope",
fzf = "FZF", dashboard = "Dashboard",
alpha = "Alpha", packer = "Packer",
["lsp-installer"] = "LSP Installer" fzf = "FZF",
}, -- shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } ) alpha = "Alpha",
buffers_color = { ["lsp-installer"] = "LSP Installer",
active = nil, -- color for active buffer }, -- shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } )
inactive = nil -- color for inactive buffer buffers_color = {
} active = nil, -- color for active buffer
} inactive = nil, -- color for inactive buffer
}, },
lualine_b = {}, },
lualine_c = {}, },
lualine_x = {}, lualine_b = {},
lualine_y = {}, lualine_c = {},
lualine_z = { lualine_x = {},
{ lualine_y = {},
[[string.format("Tab %d/%d", vim.fn.tabpagenr(), vim.fn.tabpagenr('$'))]], lualine_z = {
cond = function() {
return fn.tabpagenr("$") > 1 [[string.format("Tab %d/%d", vim.fn.tabpagenr(), vim.fn.tabpagenr('$'))]],
end cond = function()
}, return fn.tabpagenr("$") > 1
{ end,
[[harpoon_status()]], },
cond = function() {
return require("harpoon.mark").get_length() > 0 [[harpoon_status()]],
end cond = function()
} return require("harpoon.mark").get_length() > 0
} end,
}, },
extensions = {} },
} },
extensions = {},
})
------------- -------------
-- HARPOON -- -- HARPOON --
@@ -203,23 +213,21 @@ require("lualine").setup {
--Here is the set of global settings and their default values. --Here is the set of global settings and their default values.
require("harpoon").setup( require("harpoon").setup({
{ global_settings = {
global_settings = { save_on_toggle = false,
save_on_toggle = false, save_on_change = true,
save_on_change = true, enter_on_sendcmd = false,
enter_on_sendcmd = false, tmux_autoclose_windows = false,
tmux_autoclose_windows = false, excluded_filetypes = { "harpoon" },
excluded_filetypes = {"harpoon"} },
} })
}
)
-------------- --------------
-- NVIM FZF -- -- NVIM FZF --
-------------- --------------
require("fzf").default_options = { require("fzf").default_options = {
fzf_cli_args = " --height 100% --preview='bat --color=always --style=header,grid --line-range :300 {}' " fzf_cli_args = " --height 100% --preview='bat --color=always --style=header,grid --line-range :300 {}' ",
} }
---------------------- ----------------------
@@ -250,10 +258,14 @@ require("fzf").default_options = {
--} --}
--vim.opt.listchars:append("eol:↴") --vim.opt.listchars:append("eol:↴")
--vim.opt.listchars:append("space:⋅") --vim.opt.listchars:append("space:⋅")
vim.opt.list = true opt.list = true
require("indent_blankline").setup { require("indent_blankline").setup({
space_char_blankline = " ", space_char_blankline = " ",
show_current_context = true, show_current_context = true,
show_current_context_start = true show_current_context_start = true,
} })
-- PETOBENS/POET-V --
g.poetv_executables = { "poetry" }
g.poetv_auto_activate = 1
+143 -144
View File
@@ -1,5 +1,4 @@
local bug = local bug = [[
[[
Weird bug: Weird bug:
@@ -25,233 +24,233 @@ vim.g.my_harpoon_tab_switch = false
-- `true` - harpoon -- `true` - harpoon
-- `false` - buffers -- `false` - buffers
local function harpoon_tab_switch() local function harpoon_tab_switch()
--return require("harpoon.mark").get_length() > 0 --return require("harpoon.mark").get_length() > 0
return vim.g.my_harpoon_tab_switch return vim.g.my_harpoon_tab_switch
end end
-- Checks if a table contains a value. -- Checks if a table contains a value.
local function has_value(tab, val) local function has_value(tab, val)
for _, value in ipairs(tab) do for _, value in ipairs(tab) do
if value == val then if value == val then
return true return true
end end
end end
return false return false
end end
local strip_dot_slash = function(str) local strip_dot_slash = function(str)
local first_two = string.sub(str, 1, 2) local first_two = string.sub(str, 1, 2)
if first_two == "./" then if first_two == "./" then
str = string.sub(str, 3) str = string.sub(str, 3)
end end
return str return str
end end
local fzf_run_with_opts = function(args) local fzf_run_with_opts = function(args)
local opts = require("fzf").default_options local opts = require("fzf").default_options
opts.width = math.floor(vim.o.columns * 0.9) opts.width = math.floor(vim.o.columns * 0.9)
opts.height = math.floor(vim.o.lines * 0.6) opts.height = math.floor(vim.o.lines * 0.6)
local old_cli_args = opts.fzf_cli_args local old_cli_args = opts.fzf_cli_args
if args.multi then if args.multi then
opts.fzf_cli_args = opts.fzf_cli_args .. " --multi " opts.fzf_cli_args = opts.fzf_cli_args .. " --multi "
end end
local results = args.fn() local results = args.fn()
opts.fzf_cli_args = old_cli_args opts.fzf_cli_args = old_cli_args
return results return results
end end
-- Does a fzf function call with the default options set. -- Does a fzf function call with the default options set.
-- idk if there's a better way to do this -- idk if there's a better way to do this
local fzf_call = function(args) local fzf_call = function(args)
local fn = function() local fn = function()
local fzf = require("fzf").fzf local fzf = require("fzf").fzf
if args.flags then if args.flags then
return fzf(args.items, args.flags) return fzf(args.items, args.flags)
elseif args.items then elseif args.items then
return fzf(args.items) return fzf(args.items)
else else
return fzf() return fzf()
end end
end end
local results = fzf_run_with_opts({fn = fn, multi = args.multi}) local results = fzf_run_with_opts({ fn = fn, multi = args.multi })
local stripped_results = {} local stripped_results = {}
for _, filepath in ipairs(results) do for _, filepath in ipairs(results) do
stripped_results[#stripped_results + 1] = strip_dot_slash(filepath) stripped_results[#stripped_results + 1] = strip_dot_slash(filepath)
end end
return stripped_results return stripped_results
end end
--coroutine.wrap(fzf_call)() --coroutine.wrap(fzf_call)()
-- Returns list of buffer file paths. -- Returns list of buffer file paths.
-- Does not include buffers without a file path. -- Does not include buffers without a file path.
local get_buffer_paths = function() local get_buffer_paths = function()
local buffers = {} local buffers = {}
for b = 1, vim.fn.bufnr "$" do for b = 1, vim.fn.bufnr("$") do
if vim.fn.buflisted(b) ~= 0 and vim.api.nvim_buf_get_option(b, "buftype") == "" then if vim.fn.buflisted(b) ~= 0 and vim.api.nvim_buf_get_option(b, "buftype") == "" then
local buf_path = vim.fn.expand("#" .. b) local buf_path = vim.fn.expand("#" .. b)
if buf_path ~= "" then if buf_path ~= "" then
buffers[#buffers + 1] = strip_dot_slash(buf_path) buffers[#buffers + 1] = strip_dot_slash(buf_path)
--print(buf_path) --print(buf_path)
end end
end end
end end
return buffers return buffers
end end
-- toggles tab mode -- toggles tab mode
function _G.harpoon_btoggle(on) function _G.harpoon_btoggle(on)
if on == nil then if on == nil then
vim.g.my_harpoon_tab_switch = require("harpoon.mark").get_length() > 0 and not vim.g.my_harpoon_tab_switch vim.g.my_harpoon_tab_switch = require("harpoon.mark").get_length() > 0 and not vim.g.my_harpoon_tab_switch
else else
vim.g.my_harpoon_tab_switch = on and require("harpoon.mark").get_length() > 0 vim.g.my_harpoon_tab_switch = on and require("harpoon.mark").get_length() > 0
end end
print(vim.g.my_harpoon_tab_switch and "Tab: Harpoon" or "Tab: Buffer") print(vim.g.my_harpoon_tab_switch and "Tab: Harpoon" or "Tab: Buffer")
end end
-- Dynamically switches between bnext and harpoon.ui.nav_next -- Dynamically switches between bnext and harpoon.ui.nav_next
function _G.harpoon_bnext() function _G.harpoon_bnext()
if harpoon_tab_switch() then if harpoon_tab_switch() then
require("harpoon.ui").nav_next() require("harpoon.ui").nav_next()
print("Harpoon nav_next") print("Harpoon nav_next")
else else
vim.api.nvim_command("bnext") vim.api.nvim_command("bnext")
print("bnext") print("bnext")
end end
end end
-- Dynamically switches between bprevious and harpoon.ui.nav_prev -- Dynamically switches between bprevious and harpoon.ui.nav_prev
function _G.harpoon_bprevious() function _G.harpoon_bprevious()
if harpoon_tab_switch() then if harpoon_tab_switch() then
require("harpoon.ui").nav_prev() require("harpoon.ui").nav_prev()
print("Harpoon nav_prev") print("Harpoon nav_prev")
else else
vim.api.nvim_command("bprevious") vim.api.nvim_command("bprevious")
print("bprevious") print("bprevious")
end end
end end
-- Runs harpoon.mark.toggle_file and refreshes lualine elements -- Runs harpoon.mark.toggle_file and refreshes lualine elements
function _G.harpoon_toggle_file() function _G.harpoon_toggle_file()
require("harpoon.mark").add_file() require("harpoon.mark").add_file()
vim.api.nvim_command("redrawtabline") vim.api.nvim_command("redrawtabline")
vim.api.nvim_command("redrawstatus") vim.api.nvim_command("redrawstatus")
end end
function _G.harpoon_clear_all() function _G.harpoon_clear_all()
require("harpoon.mark").clear_all() require("harpoon.mark").clear_all()
_G.harpoon_btoggle() _G.harpoon_btoggle()
vim.api.nvim_command("redrawtabline") vim.api.nvim_command("redrawtabline")
vim.api.nvim_command("redrawstatus") vim.api.nvim_command("redrawstatus")
end end
-- I want my bclose bindings to also remove harpoon marks -- I want my bclose bindings to also remove harpoon marks
function _G.harpoon_rm_file() function _G.harpoon_rm_file()
require("harpoon.mark").rm_file() require("harpoon.mark").rm_file()
vim.api.nvim_command("Bclose") vim.api.nvim_command("Bclose")
end end
-- Lualine status element for harpoon -- Lualine status element for harpoon
function _G.harpoon_status() function _G.harpoon_status()
local marked_files = require("harpoon.mark").get_length() local marked_files = require("harpoon.mark").get_length()
local status_str = "Harpoon: %d file" local status_str = "Harpoon: %d file"
if marked_files > 1 then if marked_files > 1 then
status_str = status_str .. "s" status_str = status_str .. "s"
end end
status_str = (harpoon_tab_switch() and "" or "") .. status_str status_str = (harpoon_tab_switch() and "" or "") .. status_str
return string.format(status_str, marked_files) return string.format(status_str, marked_files)
end end
-- Marks buffers for harpoon -- Marks buffers for harpoon
local buffer_to_harpoon = function() local buffer_to_harpoon = function()
local buf_paths = get_buffer_paths() local buf_paths = get_buffer_paths()
local results = fzf_call({items = buf_paths, multi = true}) local results = fzf_call({ items = buf_paths, multi = true })
if results then if results then
local sorted_results = {} local sorted_results = {}
-- original buf_paths table is correctly ordered, easier to take from there -- original buf_paths table is correctly ordered, easier to take from there
-- and just check if each item is in results. -- and just check if each item is in results.
for _, filepath in ipairs(buf_paths) do for _, filepath in ipairs(buf_paths) do
if has_value(results, filepath) then if has_value(results, filepath) then
sorted_results[#sorted_results + 1] = filepath sorted_results[#sorted_results + 1] = filepath
end end
end end
local Marked = require("harpoon.mark") local Marked = require("harpoon.mark")
Marked.set_mark_list(sorted_results) Marked.set_mark_list(sorted_results)
_G.harpoon_btoggle(true) _G.harpoon_btoggle(true)
end end
end end
function _G.fzf_buffer_add_to_harpoon() function _G.fzf_buffer_add_to_harpoon()
coroutine.wrap(buffer_to_harpoon)() coroutine.wrap(buffer_to_harpoon)()
end end
-- Opens files from fzf, then marks them with harpoon. -- Opens files from fzf, then marks them with harpoon.
local files_to_harpoon = function() local files_to_harpoon = function()
local results = fzf_call({multi = true}) local results = fzf_call({ multi = true })
if results then if results then
-- opens all results into buffer -- opens all results into buffer
local cmd = ":n " local cmd = ":n "
for _, filepath in ipairs(results) do for _, filepath in ipairs(results) do
cmd = cmd .. filepath .. " " cmd = cmd .. filepath .. " "
end end
vim.cmd(cmd) vim.cmd(cmd)
local buf_paths = get_buffer_paths() local buf_paths = get_buffer_paths()
local sorted_results = {} local sorted_results = {}
for _, filepath in ipairs(buf_paths) do for _, filepath in ipairs(buf_paths) do
print(filepath) print(filepath)
if has_value(results, filepath) then if has_value(results, filepath) then
sorted_results[#sorted_results + 1] = filepath sorted_results[#sorted_results + 1] = filepath
end end
end end
local Marked = require("harpoon.mark") local Marked = require("harpoon.mark")
Marked.set_mark_list(sorted_results) Marked.set_mark_list(sorted_results)
_G.harpoon_btoggle(true) _G.harpoon_btoggle(true)
end end
end end
function _G.fzf_files_to_harpoon() function _G.fzf_files_to_harpoon()
coroutine.wrap(files_to_harpoon)() coroutine.wrap(files_to_harpoon)()
end end
local get_marked_file_names = function() local get_marked_file_names = function()
local Marked = require("harpoon.mark") local Marked = require("harpoon.mark")
local filepaths = {} local filepaths = {}
for i = 1, Marked.get_length() do for i = 1, Marked.get_length() do
filepaths[#filepaths + 1] = Marked.get_marked_file_name(i) filepaths[#filepaths + 1] = Marked.get_marked_file_name(i)
end end
return filepaths return filepaths
end end
local select_harpoon_mark = function() local select_harpoon_mark = function()
local results = fzf_call({items = get_marked_file_names()}) local results = fzf_call({ items = get_marked_file_names() })
if results then if results then
vim.api.nvim_win_set_buf(0, vim.fn.bufnr(results[1])) vim.api.nvim_win_set_buf(0, vim.fn.bufnr(results[1]))
end end
end end
function _G.fzf_select_harpoon_mark() function _G.fzf_select_harpoon_mark()
coroutine.wrap(select_harpoon_mark)() coroutine.wrap(select_harpoon_mark)()
end end
_G.harpoon_open_marks = function() _G.harpoon_open_marks = function()
local filepaths = get_marked_file_names() local filepaths = get_marked_file_names()
if #filepaths ~= 0 then if #filepaths ~= 0 then
local cmd = ":n " local cmd = ":n "
for _, filepath in ipairs(filepaths) do for _, filepath in ipairs(filepaths) do
cmd = cmd .. filepath .. " " cmd = cmd .. filepath .. " "
end end
vim.cmd(cmd) vim.cmd(cmd)
end end
end end
+13 -12
View File
@@ -3,11 +3,11 @@ require("functions")
--local fn = vim.fn -- to call Vim functions e.g. fn.bufnr() --local fn = vim.fn -- to call Vim functions e.g. fn.bufnr()
local function map(mode, lhs, rhs, opts) local function map(mode, lhs, rhs, opts)
local options = {noremap = true} local options = { noremap = true }
if opts then if opts then
options = vim.tbl_extend("force", options, opts) options = vim.tbl_extend("force", options, opts)
end end
vim.api.nvim_set_keymap(mode, lhs, rhs, options) vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end end
vim.g.mapleader = "," vim.g.mapleader = ","
@@ -17,7 +17,7 @@ map("v", "<C-C>", '"+y')
--map("n", "<S-Tab>", ":bprevious<CR>") --map("n", "<S-Tab>", ":bprevious<CR>")
map("n", "<Tab>", ":lua harpoon_bnext()<CR>") map("n", "<Tab>", ":lua harpoon_bnext()<CR>")
map("n", "<S-Tab>", ":lua harpoon_bprevious()<CR>") map("n", "<S-Tab>", ":lua harpoon_bprevious()<CR>")
map("n", "<esc>", ":noh<cr><esc>", {silent = true}) --After searching, pressing escape stops the highlight --map("n", "<esc>", ":noh<cr><esc>", { silent = true }) --After searching, pressing escape stops the highlight
--map("n", "<Leader>w", [[:%s/\s\+$//e<CR>]]) --map("n", "<Leader>w", [[:%s/\s\+$//e<CR>]])
--map("n", "<Leader>x", ":Bclose <CR>") --map("n", "<Leader>x", ":Bclose <CR>")
@@ -84,10 +84,10 @@ local hopline = [[<cmd>lua require'hop'.hint_lines_skip_whitespace(]] .. hop_opt
--map("n", "<m-w>", hopword, {silent = true}) --map("n", "<m-w>", hopword, {silent = true})
--map("v", "<m-w>", hopword, {silent = true}) --map("v", "<m-w>", hopword, {silent = true})
map("n", "W", hopline, {silent = true}) map("n", "W", hopline, { silent = true })
map("v", "W", hopline, {silent = true}) map("v", "W", hopline, { silent = true })
map("n", "w", hopword, {silent = true}) map("n", "w", hopword, { silent = true })
map("v", "w", hopword, {silent = true}) map("v", "w", hopword, { silent = true })
-- args: direction: bool, inclusive: bool -- args: direction: bool, inclusive: bool
-- inclusive is broken in hop as of this comment -- inclusive is broken in hop as of this comment
@@ -152,7 +152,8 @@ map("n", "<Leader>p", ":Buffers<CR>")
map("n", "<Leader>h", ":Helptags<CR>") map("n", "<Leader>h", ":Helptags<CR>")
map("n", "<Leader>;", ":History:<CR>") map("n", "<Leader>;", ":History:<CR>")
map("n", "<Leader>c", ":Commands<CR>") map("n", "<Leader>c", ":Commands<CR>")
map("n", "<Leader>r", ":Rg<CR>") map("n", "<Leader>r", ":Rg <C-R><C-W><CR>")
map("n", "<Leader>R", ":Rg<CR>")
map("n", "<Leader>s", ":Lines<CR>") map("n", "<Leader>s", ":Lines<CR>")
--map("n", "<Leader>[", ":Windows <CR>") --map("n", "<Leader>[", ":Windows <CR>")
@@ -170,7 +171,7 @@ map("n", "<Leader>gb", ":GBranches<CR>")
--------- ---------
--map("n", "<c-k>", ":ALEPreviousWrap <CR>", {silent = true}) --map("n", "<c-k>", ":ALEPreviousWrap <CR>", {silent = true})
--map("n", "<c-j>", ":ALENextWrap <CR>", {silent = true}) --map("n", "<c-j>", ":ALENextWrap <CR>", {silent = true})
map("n", "<space>f", ":ALEFix<CR>", {silent = true}) --map("n", "<space>f", ":ALEFix<CR>", {silent = true})
------------- -------------
-- HARPOON -- -- HARPOON --
+259 -273
View File
@@ -1,305 +1,291 @@
local opt = vim.opt -- to set options -- ooooo ooooo .o8
-- -- `888' `888' "888
-------------------- -- 888 888 .ooooo. .oooo. .oooo888 .ooooo. oooo d8b
-- NVIM-AUTOPAIRS -- -- 888ooooo888 d88' `88b `P )88b d88' `888 d88' `88b `888""8P
-------------------- -- 888 888 888ooo888 .oP"888 888 888 888ooo888 888
require("nvim-autopairs").setup {check_ts = true} -- 888 888 888 .o d8( 888 888 888 888 .o 888
-- o888o o888o `Y8bod8P' `Y888""8o `Y8bod88P" `Y8bod8P' d888b
-------------- -- https://patorjk.com/software/taag/#p=display&f=Roman&t=WORD_TO_MAKE_HEADER
-- NVIM-CMP --
-------------- -- .oooooo. oooo .o8 oooo
-- d8P' `Y8b `888 "888 `888
-- 888 888 .ooooo. 888oooo. .oooo. 888
-- 888 888 d88' `88b d88' `88b `P )88b 888
-- 888 ooooo 888 888 888 888 888 .oP"888 888
-- `88. .88' 888 888 888 888 888 d8( 888 888
-- `Y8bood8P' o888o `Y8bod8P' `Y8bod8P' `Y888""8o o888o
local opt = vim.opt -- to set options
vim.diagnostic.config({
virtual_text = true,
signs = true,
update_in_insert = false,
})
local config = {
root_dir = require("lspconfig.util").root_pattern(
"manage.py",
"pyproject.toml",
"package.json",
".null-ls-root",
"Makefile",
".git"
),
on_attach = function(client, bufnr)
local function buf_set_keymap(...)
vim.api.nvim_buf_set_keymap(bufnr, ...)
end
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
---- Disables document formatting by lsp
--client.resolved_capabilities.document_formatting = false
--client.resolved_capabilities.document_range_formatting = false
-- Enable completion triggered by <c-x><c-o>
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
-- Mappings.
local opts = { noremap = true, silent = true }
-- See `:help vim.lsp.*` for documentation on any of the below functions
buf_set_keymap("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
buf_set_keymap("n", "<space>D", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
buf_set_keymap("n", "<space>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
buf_set_keymap("n", "<space>e", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
buf_set_keymap("n", "<space>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
buf_set_keymap("n", "<space>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
buf_set_keymap("n", "<space>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
buf_set_keymap("n", "<space>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
buf_set_keymap("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
buf_set_keymap("n", "[d", "<cmd>lua vim.diagnostic.goto_prev({wrap = true})<CR>", opts)
buf_set_keymap("n", "]d", "<cmd>lua vim.diagnostic.goto_next({wrap = true})<CR>", opts)
buf_set_keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
buf_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
end,
}
-- .oooooo. ooo ooooo ooooooooo.
-- d8P' `Y8b `88. .888' `888 `Y88.
-- 888 888b d'888 888 .d88'
-- 888 8 Y88. .P 888 888ooo88P'
-- 888 8 `888' 888 888
-- `88b ooo 8 Y 888 888
-- `Y8bood8P' o8o o888o o888o
require("nvim-autopairs").setup({ check_ts = true })
-- Set completeopt to have a better completion experience -- Set completeopt to have a better completion experience
opt.completeopt = "menuone,noselect" opt.completeopt = "menuone,noselect"
local has_words_before = function()
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 cmp_autopairs = require("nvim-autopairs.completion.cmp") local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp = require("cmp") local cmp = require("cmp")
-- LUASNIP CMP THINGS
--local luasnip = require("luasnip")
--
--local luasnip_expand = function(args)
-- luasnip.lsp_expand(args.body)
--end
--
--local luasnip_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"}
--)
--
--local luasnip_shift_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"}
--)
-- CMP NVIM ULTISNIP -- CMP NVIM ULTISNIP
local cmp_ultisnips_mappings = require("cmp_nvim_ultisnips.mappings") local cmp_ultisnips_mappings = require("cmp_nvim_ultisnips.mappings")
local ultisnip = { local ultisnip = {
expand = function(args) expand = function(args)
vim.fn["UltiSnips#Anon"](args.body) vim.fn["UltiSnips#Anon"](args.body)
end, end,
tab = cmp.mapping( tab = cmp.mapping(function(fallback)
function(fallback) cmp_ultisnips_mappings.compose({ "select_next_item" })(fallback)
--cmp_ultisnips_mappings.jump_forwards(fallback) end, { "i", "s" }),
--cmp_ultisnips_mappings.compose({"jump_forwards", "select_next_item"})(fallback) shift_tab = cmp.mapping(function(fallback)
cmp_ultisnips_mappings.compose({"select_next_item"})(fallback) cmp_ultisnips_mappings.compose({ "select_prev_item" })(fallback)
end, end, { "i", "s" }),
{"i", "s"}
),
shift_tab = cmp.mapping(
function(fallback)
--cmp_ultisnips_mappings.jump_backwards(fallback)
cmp_ultisnips_mappings.compose({"select_prev_item"})(fallback)
end,
{"i", "s"}
)
} }
cmp.setup { cmp.setup({
snippet = { snippet = {
expand = ultisnip.expand expand = ultisnip.expand,
}, },
mapping = { mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(), ["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(), ["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4), ["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(), ["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm { ["<CR>"] = cmp.mapping.confirm({
--behavior = cmp.ConfirmBehavior.Replace, select = true,
select = true }),
}, ["<Tab>"] = ultisnip.tab,
["<Tab>"] = ultisnip.tab, ["<S-Tab>"] = ultisnip.shift_tab,
["<S-Tab>"] = ultisnip.shift_tab },
}, sources = {
sources = { { name = "nvim_lsp" },
{name = "nvim_lsp"}, { name = "ultisnips" },
--{name = "luasnip"}, },
{name = "ultisnips"} })
}
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
-- ooooo ooo oooo oooo ooooo .oooooo..o
-- `888b. `8' `888 `888 `888' d8P' `Y8
-- 8 `88b. 8 oooo oooo 888 888 888 Y88bo.
-- 8 `88b. 8 `888 `888 888 888 888 `"Y8888o.
-- 8 `88b.8 888 888 888 888 888 `"Y88b
-- 8 `888 888 888 888 888 888 o oo .d8P
-- o8o `8 `V88V"V8P' o888o o888o o888ooooood8 8""88888P'
local null_ls = require("null-ls")
-- ORDER IN TABLE DETERMINES EXECUTION ORDER
local sources = {
-- python
null_ls.builtins.diagnostics.flake8,
null_ls.builtins.diagnostics.mypy,
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.isort,
-- js
null_ls.builtins.diagnostics.eslint,
null_ls.builtins.code_actions.eslint,
null_ls.builtins.formatting.prettier.with({
extra_filetypes = { "svelte" },
}),
-- lua
null_ls.builtins.formatting.stylua,
-- bash
null_ls.builtins.formatting.shfmt,
null_ls.builtins.diagnostics.shellcheck,
null_ls.builtins.code_actions.shellcheck,
-- cpp
null_ls.builtins.formatting.clang_format,
-- latex
null_ls.builtins.formatting.latexindent,
null_ls.builtins.diagnostics.chktex,
-- golang
null_ls.builtins.diagnostics.golangci_lint,
-- sql
--null_ls.builtins.diagnostics.sqlfluff.with({
-- --filetypes = { "sql", "html" },
-- args = { "lint", "--dialect", "ansi", "-f", "github-annotation", "-n", "--disable_progress_bar", "-" },
--}),
--null_ls.builtins.formatting.sqlfluff.with({
-- --filetypes = { "sql", "html" },
-- args = { "fix", "--dialect", "ansi", "--disable_progress_bar", "-f", "-n", "-" },
--}),
} }
null_ls.setup({
sources = sources,
on_attach = config.on_attach,
root_dir = config.root_dir,
})
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({map_char = {tex = ""}})) -- ooooo .oooooo..o ooooooooo. ooooo . oooo oooo
-- `888' d8P' `Y8 `888 `Y88. `888' .o8 `888 `888
-- 888 Y88bo. 888 .d88' 888 ooo. .oo. .oooo.o .o888oo .oooo. 888 888 .ooooo. oooo d8b
-- 888 `"Y8888o. 888ooo88P' 888 `888P"Y88b d88( "8 888 `P )88b 888 888 d88' `88b `888""8P
-- 888 `"Y88b 888 888 888 888 `"Y88b. 888 .oP"888 888 888 888ooo888 888
-- 888 o oo .d8P 888 888 888 888 o. )88b 888 . d8( 888 888 888 888 .o 888
-- o888ooooood8 8""88888P' o888o o888o o888o o888o 8""888P' "888" `Y888""8o o888o o888o `Y8bod8P' d888b
-------------------- local on_attach_tsserver = function(client, bufnr)
-- NVIM-AUTOPAIRS -- local ts_utils = require("nvim-lsp-ts-utils")
-------------------- ts_utils.setup({
eslint_bin = "eslint_d",
eslint_enable_diagnostics = true,
eslint_enable_code_actions = true,
enable_import_on_completion = true,
filter_out_diagnostics_by_severity = {
"information",
"hint",
--"warning",
--"error",
},
})
ts_utils.setup_client(client)
--require("nvim-autopairs").setup {} -- no default maps, so you may want to define some here
-- local o = { silent = true }
---- you need setup cmp first put this after cmp.setup() vim.api.nvim_buf_set_keymap(bufnr, "n", "gs", ":TSLspOrganize<CR>", o)
--require("nvim-autopairs.completion.cmp").setup( vim.api.nvim_buf_set_keymap(bufnr, "n", "rN", ":TSLspRenameFile<CR>", o)
-- { vim.api.nvim_buf_set_keymap(bufnr, "n", "gI", ":TSLspImportAll<CR>", o)
-- map_cr = true, -- map <CR> on insert mode
-- map_complete = true, -- it will auto insert `(` (map_char) after select function or method item
-- auto_select = true, -- automatically select the first item
-- insert = false, -- use insert confirm behavior instead of replace
-- map_char = {
-- -- modifies the function or method delimiter by filetypes
-- all = "(",
-- tex = "{"
-- }
-- }
--)
------------------------
-- NVIM-LSP-INSTALLER --
------------------------
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local common_on_attach = function(client, bufnr)
local function buf_set_keymap(...)
vim.api.nvim_buf_set_keymap(bufnr, ...)
end
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
--client.resolved_capabilities.document_formatting = false
--client.resolved_capabilities.document_range_formatting = false
-- Enable completion triggered by <c-x><c-o>
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
-- Mappings.
local opts = {noremap = true, silent = true}
-- See `:help vim.lsp.*` for documentation on any of the below functions
--buf_set_keymap("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
buf_set_keymap("n", "<space>D", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
buf_set_keymap("n", "<space>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
buf_set_keymap("n", "<space>e", "<cmd>lua vim.diagnostic.show_line_diagnostics()<CR>", opts)
buf_set_keymap("n", "<space>F", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
buf_set_keymap("n", "<space>q", "<cmd>lua vim.diagnostic.set_loclist()<CR>", opts)
buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
buf_set_keymap("n", "<space>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
buf_set_keymap("n", "<space>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
buf_set_keymap("n", "<space>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
buf_set_keymap("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
buf_set_keymap("n", "<C-[>", "<cmd>lua vim.diagnostic.goto_prev({wrap = true})<CR>", opts)
buf_set_keymap("n", "<C-]>", "<cmd>lua vim.diagnostic.goto_next({wrap = true})<CR>", opts)
buf_set_keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
buf_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
end end
-- enable null-ls integration (optional) require("nvim-lsp-installer").on_server_ready(function(server)
-- lspconfig integration is deprecated; pass options to setup instead --Enable (broadcasting) snippet capability for completion
--require("null-ls").config {} local capabilities = vim.lsp.protocol.make_client_capabilities()
require("null-ls").setup { capabilities.textDocument.completion.completionItem.snippetSupport = true
on_attach = common_on_attach,
--}
--require("lspconfig")["null-ls"].setup {
handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics,
{
virtual_text = false
}
)
}
}
local tsserver_on_attach = function(client, bufnr) local disable_diag = {
local ts_utils = require("nvim-lsp-ts-utils") ["textDocument/publishDiagnostics"] = function() end,
ts_utils.setup { }
eslint_bin = "eslint_d",
eslint_enable_diagnostics = true,
eslint_enable_code_actions = true,
enable_import_on_completion = true,
filter_out_diagnostics_by_severity = {
"information",
"hint"
--"warning",
--"error",
}
}
ts_utils.setup_client(client)
-- no default maps, so you may want to define some here local on_attach_generic = function(client, bufnr)
local o = {silent = true} -- Disables document formatting by lsp
vim.api.nvim_buf_set_keymap(bufnr, "n", "gs", ":TSLspOrganize<CR>", o) client.resolved_capabilities.document_formatting = false
vim.api.nvim_buf_set_keymap(bufnr, "n", "rN", ":TSLspRenameFile<CR>", o) client.resolved_capabilities.document_range_formatting = false
vim.api.nvim_buf_set_keymap(bufnr, "n", "gI", ":TSLspImportAll<CR>", o)
common_on_attach(client, bufnr) config.on_attach(client, bufnr)
end end
require("nvim-lsp-installer").on_server_ready( local opts = {
function(server) on_attach = on_attach_generic,
--Enable (broadcasting) snippet capability for completion capabilities = capabilities,
local capabilities = vim.lsp.protocol.make_client_capabilities() flags = {
capabilities.textDocument.completion.completionItem.snippetSupport = true debounce_text_changes = 150,
},
settings = {
format = { enable = true },
},
root_dir = config.root_dir,
}
local opts = { if server.name == "tsserver" then
on_attach = common_on_attach, opts.on_attach = function(...)
capabilities = capabilities, on_attach_tsserver(...)
flags = { on_attach_generic(...)
debounce_text_changes = 150 end
}, elseif server.name == "sumneko_lua" then
settings = { opts.settings.Lua = {
format = {enable = true} diagnostics = {
}, globals = {
handlers = { "vim",
["textDocument/publishDiagnostics"] = vim.lsp.with( "awesome",
vim.lsp.diagnostic.on_publish_diagnostics, "client",
{ },
virtual_text = false },
} }
) end
}
}
--local vscode_servers = {html = "html", jsonls = "json", cssls = "css"} server:setup(opts)
--local lang = vscode_servers[server.name] vim.cmd([[do User LspAttachBuffers]])
end)
--if lang ~= nil then
-- opts.cmd = {("vscode-" .. lang .. "-language-server"), "--stdio"}
--end
if server.name == "tsserver" then
opts.on_attach = tsserver_on_attach
elseif server.name == "sumneko_lua" then
opts.settings.Lua = {
diagnostics = {
globals = {
-- neovim
"vim",
-- awesome
"awesome",
"client"
}
}
}
elseif server.name == "diagnosticls" then
opts = {
filetypes = {"python"},
init_options = {
formatters = {
black = {
command = "black",
args = {"--quiet", "-"},
rootPatterns = {"pyproject.toml", "setup.cfg"}
},
formatFiletypes = {
python = {"black"}
}
}
}
}
end
server:setup(opts)
vim.cmd [[do User LspAttachBuffers]]
end
)
local lsp_installer_servers = require("nvim-lsp-installer.servers") local lsp_installer_servers = require("nvim-lsp-installer.servers")
local auto_servers = { local auto_servers = {
"pylsp", --"pylsp",
--"pyright", --"pyright",
"sumneko_lua", "sumneko_lua",
"tsserver", "tsserver",
"bashls", "bashls",
"vimls", "vimls",
"rust_analyzer", "rust_analyzer",
"html", "html",
"cssls", "cssls",
"jsonls", "jsonls",
"omnisharp", --"omnisharp",
"eslint" "ltex",
--"diagnosticls" "jedi_language_server",
--"eslintls" "vuels",
"svelte",
"gopls",
"golangci_lint_ls",
} }
for _, s in ipairs(auto_servers) do for _, s in ipairs(auto_servers) do
local ok, server = lsp_installer_servers.get_server(s) local ok, server = lsp_installer_servers.get_server(s)
if ok and not server:is_installed() then if ok and not server:is_installed() then
server:install() server:install()
end end
end end
+3 -3
View File
@@ -2,7 +2,7 @@ local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then if fn.empty(fn.glob(install_path)) > 0 then
fn.system({"git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path}) fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
vim.cmd "packadd packer.nvim" vim.cmd("packadd packer.nvim")
vim.cmd ":PackerSync" vim.cmd(":PackerSync")
end end
+85 -86
View File
@@ -1,104 +1,103 @@
local use = require("packer").use local use = require("packer").use
require("packer").startup( require("packer").startup(function()
function() use("wbthomason/packer.nvim")
use "wbthomason/packer.nvim"
-- OPENAI CODEX -- OPENAI CODEX
--use "tom-doerr/vim_codex" --use "tom-doerr/vim_codex"
-- NAVIGATION -- NAVIGATION
use { use({
"phaazon/hop.nvim", "phaazon/hop.nvim",
--branch = "v1.2", -- optional but strongly recommended --branch = "v1.2", -- optional but strongly recommended
config = function() config = function()
-- you can configure Hop the way you like here; see :h hop-config -- you can configure Hop the way you like here; see :h hop-config
require "hop".setup {keys = "etovxqpdygfblzhckisuran"} require("hop").setup({ keys = "etovxqpdygfblzhckisuran" })
end end,
} })
--use { --use {
-- "phaazon/hop.nvim", -- "phaazon/hop.nvim",
-- as = "hop", -- as = "hop",
-- config = function() -- config = function()
-- -- you can configure Hop the way you like here; see :h hop-config -- -- you can configure Hop the way you like here; see :h hop-config
-- require "hop".setup {} -- require "hop".setup {}
-- --require "hop".setup {keys = "etovxqpdygfblzhckisuran"} -- --require "hop".setup {keys = "etovxqpdygfblzhckisuran"}
-- end -- end
--} --}
-- TABLE -- TABLE
--use "dhruvasagar/vim-table-mode" --use "dhruvasagar/vim-table-mode"
-- VIM THEMING -- VIM THEMING
--use "rafi/awesome-vim-colorschemes" -- vim themes --use "rafi/awesome-vim-colorschemes" -- vim themes
use "navarasu/onedark.nvim" use("navarasu/onedark.nvim")
use "projekt0n/github-nvim-theme" use("projekt0n/github-nvim-theme")
use "wojciechkepka/vim-github-dark" use("wojciechkepka/vim-github-dark")
use "folke/tokyonight.nvim" use("folke/tokyonight.nvim")
-- FILE MANAGEMENT -- FILE MANAGEMENT
use "junegunn/fzf" use("junegunn/fzf")
use "junegunn/fzf.vim" use("junegunn/fzf.vim")
use "rbgrouleff/bclose.vim" use("rbgrouleff/bclose.vim")
use "francoiscabrol/ranger.vim" use("francoiscabrol/ranger.vim")
use "vijaymarupudi/nvim-fzf" use("vijaymarupudi/nvim-fzf")
use "vijaymarupudi/nvim-fzf-commands" use("vijaymarupudi/nvim-fzf-commands")
use {"tpope/vim-obsession"} use({ "tpope/vim-obsession" })
-- GIT -- GIT
use "tpope/vim-fugitive" use("tpope/vim-fugitive")
use "stsewd/fzf-checkout.vim" use("stsewd/fzf-checkout.vim")
-- AIRLINE -- AIRLINE
use { use({
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
requires = {"kyazdani42/nvim-web-devicons", opt = true} requires = { "kyazdani42/nvim-web-devicons", opt = true },
} })
-- EDITOR -- EDITOR
use "windwp/nvim-autopairs" use("windwp/nvim-autopairs")
--use "jiangmiao/auto-pairs" --use "jiangmiao/auto-pairs"
use "dense-analysis/ale" --use "dense-analysis/ale"
--use "nathanmsmith/nvim-ale-diagnostic" --use "nathanmsmith/nvim-ale-diagnostic"
use "turbio/bracey.vim" use("turbio/bracey.vim")
use "lukas-reineke/indent-blankline.nvim" use("lukas-reineke/indent-blankline.nvim")
--use "sheerun/vim-polyglot" --use "sheerun/vim-polyglot"
-- SNIPPETS -- SNIPPETS
use "SirVer/ultisnips" use("SirVer/ultisnips")
use "honza/vim-snippets" use("honza/vim-snippets")
-- LSP -- LSP
use "hrsh7th/nvim-cmp" -- Autocompletion plugin use("hrsh7th/nvim-cmp") -- Autocompletion plugin
--use "saadparwaiz1/cmp_luasnip" -- Snippets source for nvim-cmp --use "saadparwaiz1/cmp_luasnip" -- Snippets source for nvim-cmp
use {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"} use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
use "neovim/nvim-lspconfig" -- Collection of configurations for built-in LSP client use("neovim/nvim-lspconfig") -- Collection of configurations for built-in LSP client
use "williamboman/nvim-lsp-installer" use("williamboman/nvim-lsp-installer")
use { use({
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
requires = "quangnguyen30192/cmp-nvim-ultisnips" requires = "quangnguyen30192/cmp-nvim-ultisnips",
} -- LSP source for nvim-cmp }) -- LSP source for nvim-cmp
use "nvim-lua/plenary.nvim" use("nvim-lua/plenary.nvim")
use "jose-elias-alvarez/nvim-lsp-ts-utils" use("jose-elias-alvarez/nvim-lsp-ts-utils")
use "jose-elias-alvarez/null-ls.nvim" use("jose-elias-alvarez/null-ls.nvim")
use "ThePrimeagen/harpoon" use("ThePrimeagen/harpoon")
use "L3MON4D3/LuaSnip" -- Snippets plugin use("L3MON4D3/LuaSnip") -- Snippets plugin
-- JS -- JS
use "HerringtonDarkholme/yats.vim" use("HerringtonDarkholme/yats.vim")
use "chemzqm/vim-jsx-improve" use("chemzqm/vim-jsx-improve")
use "yuezk/vim-js" -- js use("yuezk/vim-js") -- js
use "maxmellon/vim-jsx-pretty" -- react/tsx syntax highlight & indent use("maxmellon/vim-jsx-pretty") -- react/tsx syntax highlight & indent
--use "leafOfTree/vim-vue-plugin" -- vue syntax highlight & indent --use "leafOfTree/vim-vue-plugin" -- vue syntax highlight & indent
-- PYTHON -- PYTHON
--use {"numirias/semshi", run = ":UpdateRemotePlugins"} -- python --use {"numirias/semshi", run = ":UpdateRemotePlugins"} -- python
use "Vimjas/vim-python-pep8-indent" use("Vimjas/vim-python-pep8-indent")
--use("petobens/poet-v")
-- HTML/CSS -- HTML/CSS
use "mattn/emmet-vim" use("mattn/emmet-vim")
end end)
)
+2 -2
View File
@@ -1,4 +1,4 @@
vim.cmd [[ vim.cmd([[
" https://vim.fandom.com/wiki/Avoid_scrolling_when_switch_buffers " https://vim.fandom.com/wiki/Avoid_scrolling_when_switch_buffers
" Save current view settings on a per-window, per-buffer basis. " Save current view settings on a per-window, per-buffer basis.
@@ -27,4 +27,4 @@ vim.cmd [[
autocmd BufLeave * call AutoSaveWinView() autocmd BufLeave * call AutoSaveWinView()
autocmd BufEnter * call AutoRestoreWinView() autocmd BufEnter * call AutoRestoreWinView()
]] ]])