feat: kitty instead of alacritty -> pictures

This commit is contained in:
Fabio Lenherr / DashieTM 2023-01-05 03:57:49 +01:00
parent fb16eec496
commit f3a0d0d35f
11 changed files with 278 additions and 64 deletions

View file

@ -9,18 +9,17 @@ require("settings.pairs")
require("settings.indentline")
require("settings.project")
require("settings.dashboard")
require("settings.null-ls")
require("settings.rainbow")
require("settings.dap")
require("settings.autocommands")
require("settings.telescope")
require("settings.keymaps")
require("settings.barbar")
-- simple plugins that don't make sense to put in a seperate file, would clutter too much
require("gitsigns").setup()
require("feline").setup()
require("telescope").setup({})
require("telescope").load_extension("fzy_native")
require("impatient").enable_profile()
require("nightfox")
require('Comment').setup()
require("toggleterm").setup()

View file

@ -14,10 +14,11 @@ dashboard.section.header.val = {
}
dashboard.section.buttons.val = {
dashboard.button("f", " Find file", ":Telescope find_files <CR>"),
dashboard.button("b", " Open File Browser", ":Telescope file_browser<CR>"),
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
dashboard.button("p", " Find project", ":Telescope project <CR>"),
dashboard.button("r", " Recently used files", ":Telescope oldfiles <CR>"),
dashboard.button("t", "Find text", ":Telescope live_grep <CR>"),
dashboard.button("t", "Zoxide", ":Telescope zoxide list <CR>"),
dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua <CR>"),
dashboard.button("q", " Quit Neovim", ":qa<CR>"),
}

View file

@ -2,10 +2,6 @@ local opts = { noremap = true, silent = true }
local term_opts = { silent = true }
local keymap = vim.api.nvim_set_keymap
-- space leader
vim.g.mapleader = " "
keymap("n", "<Space>", "<Nop>", { silent = true, noremap = false })
-- debug
keymap("n", "<F5>", ':lua require("dap").toggle_breakpoint()<CR>', opts)
keymap("n", "<F6>", ':lua require("dap").step_over()<CR>', opts)
@ -15,8 +11,8 @@ keymap("n", "<F9>", ':lua require("dap").continue()<CR>', opts)
keymap("n", "<F10>", ':lua require("dap").close()<CR> :lua require("dapui").toggle()<CR>', opts)
-- file tree
keymap("n", "t", ':lua require("nvim-tree").toggle()<CR>', opts)
keymap("n", "f", ':lua require("nvim-tree").focus()<CR>', opts)
keymap("n", "t", ":ToggleTerm<CR>", opts)
keymap("n", "n", ':lua require("nvim-tree").toggle()<CR>', opts)
-- tab switching
keymap("n", "<F1>", ":BufferPrev<CR>", opts)
@ -24,14 +20,22 @@ keymap("n", "<F2>", ":BufferNext<CR>", opts)
-- formatting
keymap("n", "<F4>", ":lua vim.lsp.buf.format { async = true }<CR>", opts)
keymap("n", "<leader>q", ":Telescope lsp_definitions<CR>", opts)
keymap("n", "<leader>w", ":Telescope lsp_references<CR>", opts)
keymap("n", "<leader>e", ":Telescope lsp_type_definitions<CR>", opts)
keymap("n", "<leader>a", ":lua vim.lsp.buf.code_action()<CR>", opts)
keymap("n", "<leader>s", ":lua vim.lsp.buf.signature_help()<CR>", opts)
-- telescope
keymap("n", "fb", ":Telescope file_browser<CR>", {})
keymap("n", "fc", ":Cheatsheet<CR>", {})
keymap("n", "ff", ":lua require('telescope.builtin').find_files()<CR>", {})
keymap("n", "fg", ":lua require('telescope.builtin').live_grep()<CR>", {})
keymap("n", "fb", ":lua require('telescope.builtin').buffers()<CR>", {})
keymap("n", "fh", ":lua require('telescope.builtin').help_tags()<CR>", {})
keymap("n", "fp", ":lua require'telescope'.extensions.project.project{}<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<leader>z", ":lua require('telescope').extensions.zoxide.list{}<CR>")
-- trouble
keymap("n", "<C-f>", "<cmd>TroubleToggle<CR>", term_opts)
require("trouble").setup({
@ -41,15 +45,3 @@ require("trouble").setup({
},
})
-- LSP
local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
local opts = { noremap = true, silent = true, buffer = bufnr }
keymap("n", "<leader>h", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
keymap("n", "<leader>j", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
keymap("n", "<leader>k", "<Cmd>lua vim.lsp.buf.implementation()<CR>", opts)
keymap("n", "<leader>l", "<Cmd>lua vim.lsp.buf.references()<CR>", opts)
keymap("n", "<leader>;", "<Cmd>lua vim.lsp.buf.code_action()<CR>", opts)
keymap("n", "<leader>u", "<Cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
keymap("n", "<leader>g", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
end

View file

@ -18,10 +18,8 @@ require("mason-lspconfig").setup({
"cssls", -- css
"html", -- html
"clangd", -- cpp / c
"tsserver", -- javascript / typescript
"sumneko_lua", -- lua
"pyright", -- python
"rust_analyzer", -- rust
"cmake", -- cmake
"bashls", -- shell
"ansiblels", -- ansible
@ -32,12 +30,50 @@ require("mason-lspconfig").setup({
})
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
capabilities.textDocument.completion.completionItem.snippetSupport = true
-- LSP
local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
local optslsp = { noremap = false, silent = true, buffer = bufnr }
end
require("mason-lspconfig").setup_handlers({
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup({
capabilities = capabilities,
on_attach = on_attach,
vim.lsp.diagnostic.on_publish_diagnostics, {
-- Disable virtual_text
virtual_text = true,
}
})
end,
})
require("lsp-format").setup {}
local on_attach = function(client)
require("lsp-format").on_attach(client)
end
-- special server setups
require("clangd_extensions").setup()
require("rust-tools").setup({
server = {
standalone = false,
root_dir = require('lspconfig').util.find_git_ancestor,
loadOutputiDirs = false,
}
})
require("typescript").setup({
disable_commands = false, -- prevent the plugin from creating Vim commands
debug = false, -- enable debug logging for commands
go_to_source_definition = {
fallback = true, -- fall back to standard LSP definition on failure
},
server = { -- pass options to lspconfig's setup method
on_attach = on_attach,
},
})

View file

@ -1,36 +0,0 @@
local null_ls = require("null-ls")
require("mason-null-ls").setup({
ensure_installed = {
"prettierd",
"clang_format",
"shellharden",
"sql_formatter",
"fixjson",
"autopep8",
"stylua",
"rustfmt",
},
})
null_ls.setup({
on_attach = function(client, bufnr)
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.formatting.prettierd.with({
env = {
PRETTIERD_DEFAULT_CONFIG = vim.fn.expand("~/.config/nvim/lua/settings/.prettierrc"),
},}
),
require("null-ls").builtins.formatting.clang_format,
require("null-ls").builtins.formatting.shellharden,
require("null-ls").builtins.formatting.sql_formatter,
require("null-ls").builtins.formatting.fixjson,
require("null-ls").builtins.formatting.autopep8,
require("null-ls").builtins.formatting.stylua,
require("null-ls").builtins.formatting.rustfmt,
},
})

View file

@ -23,11 +23,16 @@ local options = {
syntax = "off",
spelllang = "en_us",
mousemodel = "popup_setpos",
shell = "/usr/bin/zsh"
}
vim.g.mkdp_browser = '/usr/bin/firefox'
vim.g.mkdp_auto_start = 1
-- space leader
vim.g.mapleader = " "
vim.keymap.set("n", "<Space>", "<Nop>", { silent = true, noremap = false })
for k, v in pairs(options) do
vim.opt[k] = v
end

View file

@ -11,8 +11,6 @@ Plug("nvim-lua/plenary.nvim") -- library, don't delete
Plug("williamboman/mason.nvim") -- lsp and dap
Plug("williamboman/mason-lspconfig.nvim") -- lsp to mason bridge
Plug("neovim/nvim-lspconfig") -- nvim lsp
Plug("jose-elias-alvarez/null-ls.nvim") -- enables formatters
Plug("jayp0521/mason-null-ls.nvim") -- mason to formatter
Plug("mfussenegger/nvim-dap") -- debugging capabilities
Plug("rcarriga/nvim-dap-ui") -- debug ui
Plug("theHamsta/nvim-dap-virtual-text") -- more debug ui
@ -43,9 +41,21 @@ Plug("nvim-telescope/telescope-ui-select.nvim") -- telescope ui
Plug("nvim-telescope/telescope-file-browser.nvim") -- telescope file browser
Plug("nvim-telescope/telescope-fzy-native.nvim") -- telescope fuzzy search
Plug('nvim-telescope/telescope-project.nvim') -- telescope projects
Plug('nvim-telescope/telescope-symbols.nvim') -- symbol picker
Plug('nvim-telescope/telescope-file-browser.nvim') -- telescope file browser
Plug('nvim-telescope/telescope-dap.nvim') -- dap UI for telescope
Plug('benfowler/telescope-luasnip.nvim') -- telescope luasnip integration
Plug('sudormrfbin/cheatsheet.nvim') -- cheatsheet for keymaps
Plug('jvgrootveld/telescope-zoxide') -- zoxide integration
Plug('ThePrimeagen/harpoon') -- harpoonman
Plug 'folke/trouble.nvim' -- provides warning/error explanation tab
Plug('akinsho/toggleterm.nvim',{ ["tag"] = "*" }) -- better terminal integration
Plug("iamcco/markdown-preview.nvim", -- markdown preview
{ ["do"] = "cd app && yarn install" })
Plug('p00f/clangd_extensions.nvim') -- clangd_extensions
Plug('jose-elias-alvarez/typescript.nvim') -- typescript extensions
Plug('kdarkhan/rust-tools.nvim') -- rust extensions
Plug('preservim/tagbar') -- tags on the right
Plug('lukas-reineke/lsp-format.nvim')
vim.call("plug#end")

View file

@ -0,0 +1,35 @@
local t = require("telescope")
local z_utils = require("telescope._extensions.zoxide.utils")
-- Configure the extension
t.setup({
extensions = {
zoxide = {
prompt_title = "[ Queries ]",
mappings = {
default = {
after_action = function(selection)
print("Update to (" .. selection.z_score .. ") " .. selection.path)
end
},
["<C-s>"] = {
before_action = function(selection) print("before C-s") end,
action = function(selection)
vim.cmd("edit " .. selection.path)
end
},
["<C-q>"] = { action = z_utils.create_basic_command("split") },
},
},
},
})
-- Load the extension
t.load_extension('zoxide')
-- Add a mapping
require("telescope").load_extension("fzy_native")
require("telescope").load_extension "file_browser"
require('telescope').load_extension('dap')
require("telescope").load_extension('harpoon')