Cleaned base and added fish config
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
set -gx fish_greeting ""
|
||||||
|
set -gx PATH /home/fucker/.local/bin:/home/fucker/.cargo/bin:$PATH
|
||||||
|
|
||||||
|
alias ls="eza -lh"
|
||||||
|
|
||||||
|
source (/usr/local/bin/starship init fish --print-full-init | psub)
|
||||||
|
uwufetch
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# This file contains fish universal variable definitions.
|
||||||
|
# VERSION: 3.0
|
||||||
|
SETUVAR __fish_initialized:3400
|
||||||
|
SETUVAR fish_color_autosuggestion:brblack
|
||||||
|
SETUVAR fish_color_cancel:\x2dr
|
||||||
|
SETUVAR fish_color_command:blue
|
||||||
|
SETUVAR fish_color_comment:red
|
||||||
|
SETUVAR fish_color_cwd:green
|
||||||
|
SETUVAR fish_color_cwd_root:red
|
||||||
|
SETUVAR fish_color_end:green
|
||||||
|
SETUVAR fish_color_error:brred
|
||||||
|
SETUVAR fish_color_escape:brcyan
|
||||||
|
SETUVAR fish_color_history_current:\x2d\x2dbold
|
||||||
|
SETUVAR fish_color_host:normal
|
||||||
|
SETUVAR fish_color_host_remote:yellow
|
||||||
|
SETUVAR fish_color_normal:normal
|
||||||
|
SETUVAR fish_color_operator:brcyan
|
||||||
|
SETUVAR fish_color_param:cyan
|
||||||
|
SETUVAR fish_color_quote:yellow
|
||||||
|
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
|
||||||
|
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
|
||||||
|
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
||||||
|
SETUVAR fish_color_status:red
|
||||||
|
SETUVAR fish_color_user:brgreen
|
||||||
|
SETUVAR fish_color_valid_path:\x2d\x2dunderline
|
||||||
|
SETUVAR fish_key_bindings:fish_default_key_bindings
|
||||||
|
SETUVAR fish_pager_color_completion:normal
|
||||||
|
SETUVAR fish_pager_color_description:yellow\x1e\x2di
|
||||||
|
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||||
|
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||||
|
SETUVAR fish_pager_color_selected_background:\x2dr
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
local opt = vim.opt -- for conciseness
|
||||||
|
|
||||||
|
-- line numbers
|
||||||
|
opt.number = true
|
||||||
|
opt.relativenumber = true
|
||||||
|
|
||||||
|
-- tabs & indentation
|
||||||
|
opt.tabstop = 4
|
||||||
|
opt.shiftwidth = 4
|
||||||
|
opt.expandtab = true
|
||||||
|
opt.autoindent = true
|
||||||
|
|
||||||
|
-- line wrapping
|
||||||
|
opt.wrap = false
|
||||||
|
|
||||||
|
-- search settings
|
||||||
|
opt.ignorecase = true
|
||||||
|
opt.smartcase = true
|
||||||
|
|
||||||
|
-- cursor line
|
||||||
|
opt.cursorline = true
|
||||||
|
|
||||||
|
-- appearance
|
||||||
|
opt.termguicolors = true
|
||||||
|
opt.background = "dark"
|
||||||
|
opt.signcolumn = "yes"
|
||||||
|
|
||||||
|
-- backspace
|
||||||
|
opt.backspace = "indent,eol,start"
|
||||||
|
|
||||||
|
-- split windows
|
||||||
|
opt.splitright = true
|
||||||
|
opt.splitbelow = true
|
||||||
|
|
||||||
|
opt.iskeyword:append("-")
|
||||||
|
|
||||||
|
require('plugins')
|
||||||
|
require('p-tree')
|
||||||
|
require('colorscheme')
|
||||||
|
require('keymaps')
|
||||||
|
require('bar')
|
||||||
|
require('teleop')
|
||||||
|
require('nvimcmp')
|
||||||
|
require('gitsign')
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
local status, lualine = pcall(require, "lualine")
|
||||||
|
if not status then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
lualine.setup({
|
||||||
|
options = {
|
||||||
|
theme = 'solarized_dark'
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
vim.cmd.colorscheme "catppuccin-frappe"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
local setup, gitsigns = pcall(require, "gitsigns")
|
||||||
|
if not setup then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
gitsigns.setup()
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
local keymap = vim.keymap -- for conciseness
|
||||||
|
|
||||||
|
-- general keymaps
|
||||||
|
keymap.set("n","<leader>to",":tabnew<CR>") -- open new tab
|
||||||
|
keymap.set("n","<leader>tx",":tabclose<CR>") -- close current tab
|
||||||
|
keymap.set("n","<leader>tn",":tabn<CR>") -- go to next tab
|
||||||
|
keymap.set("n","<leader>tp",":tabp<CR>") -- go to previous tab
|
||||||
|
|
||||||
|
keymap.set("n","<leader>sv","<C-w>v") -- split window vertically
|
||||||
|
keymap.set("n","<leader>sh","<C-w>s") -- split window horizontally
|
||||||
|
keymap.set("n","<leader>se","<C-w>=") -- make split windows equal width
|
||||||
|
keymap.set("n","<leader>sx",":close<CR>") -- close current split window
|
||||||
|
|
||||||
|
-- nvim-tree
|
||||||
|
keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>") -- toggle file explorer
|
||||||
|
|
||||||
|
-- telescope
|
||||||
|
keymap.set("n","<leader>ff", "<cmd>Telescope find_files<cr>")
|
||||||
|
keymap.set("n","<leader>fs", "<cmd>Telescope live_grep<cr>")
|
||||||
|
keymap.set("n","<leader>fc", "<cmd>Telescope grep_string<cr>")
|
||||||
|
keymap.set("n","<leader>fb", "<cmd>Telescope buffers<cr>")
|
||||||
|
keymap.set("n","<leader>fh", "<cmd>Telescope help_tags<cr>")
|
||||||
|
keymap.set("n", "<leader>gc", "<cmd>Telescope git_commits<cr>")
|
||||||
|
keymap.set("n", "<leader>gfc", "<cmd>Telescope git_bcommits<cr>")
|
||||||
|
keymap.set("n", "<leader>gb", "<cmd>Telescope git_branches<cr>")
|
||||||
|
keymap.set("n", "<leader>gs", "<cmd>Telescope git_status<cr>")
|
||||||
|
|
||||||
|
-- restart lsp server
|
||||||
|
keymap.set("n", "<leader>rs", ":LspRestart<CR>") -- mapping to restart lsp if necessary
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
-- import lspconfig plugin safely
|
||||||
|
local lspconfig_status, lspconfig = pcall(require, "lspconfig")
|
||||||
|
if not lspconfig_status then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- import cmp-nvim-lsp plugin safely
|
||||||
|
local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||||
|
if not cmp_nvim_lsp_status then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- import typescript plugin safely
|
||||||
|
local typescript_setup, typescript = pcall(require, "typescript")
|
||||||
|
if not typescript_setup then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local keymap = vim.keymap -- for conciseness
|
||||||
|
|
||||||
|
-- enable keybinds only for when lsp server available
|
||||||
|
local on_attach = function(client, bufnr)
|
||||||
|
-- keybind options
|
||||||
|
local opts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
|
|
||||||
|
-- set keybinds
|
||||||
|
keymap.set("n", "gf", "<cmd>Lspsaga lsp_finder<CR>", opts) -- show definition, references
|
||||||
|
keymap.set("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts) -- got to declaration
|
||||||
|
keymap.set("n", "gd", "<cmd>Lspsaga peek_definition<CR>", opts) -- see definition and make edits in window
|
||||||
|
keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts) -- go to implementation
|
||||||
|
keymap.set("n", "<leader>ca", "<cmd>Lspsaga code_action<CR>", opts) -- see available code actions
|
||||||
|
keymap.set("n", "<leader>rn", "<cmd>Lspsaga rename<CR>", opts) -- smart rename
|
||||||
|
keymap.set("n", "<leader>D", "<cmd>Lspsaga show_line_diagnostics<CR>", opts) -- show diagnostics for line
|
||||||
|
keymap.set("n", "<leader>d", "<cmd>Lspsaga show_cursor_diagnostics<CR>", opts) -- show diagnostics for cursor
|
||||||
|
keymap.set("n", "[d", "<cmd>Lspsaga diagnostic_jump_prev<CR>", opts) -- jump to previous diagnostic in buffer
|
||||||
|
keymap.set("n", "]d", "<cmd>Lspsaga diagnostic_jump_next<CR>", opts) -- jump to next diagnostic in buffer
|
||||||
|
keymap.set("n", "K", "<cmd>Lspsaga hover_doc<CR>", opts) -- show documentation for what is under cursor
|
||||||
|
keymap.set("n", "<leader>o", "<cmd>LSoutlineToggle<CR>", opts) -- see outline on right hand side
|
||||||
|
|
||||||
|
-- typescript specific keymaps (e.g. rename file and update imports)
|
||||||
|
if client.name == "tsserver" then
|
||||||
|
keymap.set("n", "<leader>rf", ":TypescriptRenameFile<CR>") -- rename file and update imports
|
||||||
|
keymap.set("n", "<leader>oi", ":TypescriptOrganizeImports<CR>") -- organize imports (not in youtube nvim video)
|
||||||
|
keymap.set("n", "<leader>ru", ":TypescriptRemoveUnused<CR>") -- remove unused variables (not in youtube nvim video)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- used to enable autocompletion (assign to every lsp server config)
|
||||||
|
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
|
|
||||||
|
-- Change the Diagnostic symbols in the sign column (gutter)
|
||||||
|
-- (not in youtube nvim video)
|
||||||
|
local signs = { Error = " ", Warn = " ", Hint = "ﴞ ", Info = " " }
|
||||||
|
for type, icon in pairs(signs) do
|
||||||
|
local hl = "DiagnosticSign" .. type
|
||||||
|
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- configure html server
|
||||||
|
lspconfig["html"].setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- configure typescript server with plugin
|
||||||
|
typescript.setup({
|
||||||
|
server = {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- configure css server
|
||||||
|
lspconfig["cssls"].setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- configure tailwindcss server
|
||||||
|
lspconfig["tailwindcss"].setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- configure emmet language server
|
||||||
|
lspconfig["emmet_ls"].setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- configure lua server (with special settings)
|
||||||
|
lspconfig["sumneko_lua"].setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = { -- custom settings for lua
|
||||||
|
Lua = {
|
||||||
|
-- make the language server recognize "vim" global
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
-- make language server aware of runtime files
|
||||||
|
library = {
|
||||||
|
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||||
|
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
local saga_status, saga = pcall(require, "lspsaga")
|
||||||
|
if not saga_status then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
saga.setup({
|
||||||
|
scroll_preview = {
|
||||||
|
scroll_down = "<C-f>",
|
||||||
|
scroll_up = "<C-b>"
|
||||||
|
},
|
||||||
|
definition = {
|
||||||
|
edit = "<CR>"
|
||||||
|
},
|
||||||
|
ui = {
|
||||||
|
colors = {
|
||||||
|
normal_bg = "#022746",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
require("mason").setup({
|
||||||
|
ui = {
|
||||||
|
icons = {
|
||||||
|
package_installed = "✓",
|
||||||
|
package_pending = "➜",
|
||||||
|
package_uninstalled = "✗",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"clangd",
|
||||||
|
"rust_analyzer",
|
||||||
|
"vls",
|
||||||
|
},
|
||||||
|
automatic_installation = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
require("mason-null-ls").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"prettier",
|
||||||
|
"stylua",
|
||||||
|
"eslint_d",
|
||||||
|
},
|
||||||
|
automatic_installation = true,
|
||||||
|
})
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
local setup, null_ls = pcall(require, "null-ls")
|
||||||
|
if not setup then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local formatting = null_ls.builtins.formatting
|
||||||
|
local diagnostics = null_ls.builtins.diagnostics
|
||||||
|
|
||||||
|
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||||
|
|
||||||
|
null_ls.setup({
|
||||||
|
sources = {
|
||||||
|
formatting.prettier,
|
||||||
|
formatting.stylua,
|
||||||
|
formatting.eslint_d.with({
|
||||||
|
condition = function(utils)
|
||||||
|
return utils.root_has_file('.eslintrc.js')
|
||||||
|
end,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
on_attach = function(current_client, bufnr)
|
||||||
|
if current_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()
|
||||||
|
vim.lsp.buf.format({
|
||||||
|
filter = function(client)
|
||||||
|
return client.name == "null-ls"
|
||||||
|
end,
|
||||||
|
bufnr = bufnr,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
local cmp_status, cmp = pcall(require, "cmp")
|
||||||
|
if not cmp_status then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local luasnip_status, luasnip = pcall(require, "luasnip")
|
||||||
|
if not luasnip_status then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- load friendly-snippets
|
||||||
|
require("luasnip/loaders/from_vscode").lazy_load()
|
||||||
|
|
||||||
|
vim.opt.completeopt = "menu,menuone,noselect"
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||||
|
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||||
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
||||||
|
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||||
|
}),
|
||||||
|
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
}),
|
||||||
|
})
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
|
require("nvim-tree").setup({
|
||||||
|
actions = {
|
||||||
|
open_file = {quit_on_open=true}
|
||||||
|
},
|
||||||
|
update_focused_file = {
|
||||||
|
enable = true,
|
||||||
|
update_cwd = true
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
custom = { '^.git$','node_modules$' }
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
enable = true
|
||||||
|
},
|
||||||
|
log = {
|
||||||
|
enable = true,
|
||||||
|
types = {
|
||||||
|
diagnostics = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
enable = true,
|
||||||
|
show_on_dirs=false,
|
||||||
|
debounce_delay=50,
|
||||||
|
icons = {
|
||||||
|
hint = 'H',
|
||||||
|
info = 'I',
|
||||||
|
warning = 'W',
|
||||||
|
error = 'E'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
vim.cmd [[packadd packer.nvim]]
|
||||||
|
|
||||||
|
return require('packer').startup(function(use)
|
||||||
|
use 'wbthomason/packer.nvim'
|
||||||
|
|
||||||
|
-- better bar
|
||||||
|
use 'nvim-lualine/lualine.nvim'
|
||||||
|
|
||||||
|
-- autocpompletion
|
||||||
|
use 'hrsh7th/nvim-cmp'
|
||||||
|
use 'hrsh7th/cmp-buffer'
|
||||||
|
use 'hrsh7th/cmp-path'
|
||||||
|
|
||||||
|
-- fuzzy finding
|
||||||
|
use {
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
tag = '0.1.1',
|
||||||
|
requires = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
use {
|
||||||
|
'nvim-telescope/telescope-fzf-native.nvim',
|
||||||
|
run = 'make'
|
||||||
|
}
|
||||||
|
|
||||||
|
-- colorschemes
|
||||||
|
use 'folke/tokyonight.nvim'
|
||||||
|
use {
|
||||||
|
'catppuccin/nvim',
|
||||||
|
as = 'catppuccin'
|
||||||
|
}
|
||||||
|
|
||||||
|
-- neovim explorer
|
||||||
|
use {
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
requires = {
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- formatting & linting
|
||||||
|
use 'jose-elias-alvarez/null-ls.nvim' -- configure formatters & linters
|
||||||
|
use 'jayp0521/mason-null-ls.nvim' -- bridges gap b/w mason & null-ls
|
||||||
|
|
||||||
|
-- git integration
|
||||||
|
use 'lewis6991/gitsigns.nvim'
|
||||||
|
end)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
local telescope_setup, telescope = pcall(require, "telescope")
|
||||||
|
if not telescope_setup then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local actions_setup, actions = pcall(require, "telescope.actions")
|
||||||
|
if not actions_setup then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
telescope.setup({
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["<C-k>"] = actions.move_selection_previous,
|
||||||
|
["<C-j>"] = actions.move_selection_next,
|
||||||
|
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
telescope.load_extension("fzf")
|
||||||
Reference in New Issue
Block a user