update
This commit is contained in:
+48
-46
@@ -1,26 +1,32 @@
|
||||
vim.opt.termguicolors = true
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/rose-pine/neovim", name = "rose-pine" },
|
||||
{ src = "https://github.com/norcalli/nvim-colorizer.lua" },
|
||||
{ src = "https://github.com/rose-pine/neovim", name = "rose-pine" },
|
||||
{ src = "https://github.com/brenoprata10/nvim-highlight-colors" },
|
||||
{ src = "https://github.com/mbbill/undotree" },
|
||||
{ src = "https://github.com/nvim-mini/mini.pairs", version = vim.version.range('*') },
|
||||
{ src = "https://github.com/nvim-mini/mini.pairs", version = vim.version.range('*') },
|
||||
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
|
||||
{ src = "https://github.com/ibhagwan/fzf-lua" },
|
||||
{ src = "https://github.com/saghen/blink.cmp", version = vim.version.range('*'), },
|
||||
{ src = "git@moo:dmm/polydev.git", version = "main" },
|
||||
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
|
||||
{ src = "https://github.com/saghen/blink.cmp", version = vim.version.range('*'), },
|
||||
{ src = "git@moo:dmm/polydev.git", version = "main" },
|
||||
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
|
||||
{ src = "https://github.com/alexghergh/nvim-tmux-navigation" },
|
||||
{ src = "https://github.com/mason-org/mason.nvim" },
|
||||
{ src = "https://github.com/mason-org/mason-lspconfig.nvim" },
|
||||
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
||||
{ src = "https://github.com/stevearc/conform.nvim" },
|
||||
})
|
||||
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "ts_ls", "lua_ls", "denols" },
|
||||
automatic_enable = true,
|
||||
})
|
||||
require 'nvim-tmux-navigation'.setup {
|
||||
disable_when_zoomed = true -- defaults to false
|
||||
}
|
||||
require('nvim-treesitter').install { 'rust', 'c', 'cpp', 'lua', 'nix' }
|
||||
require('nvim-treesitter').install { 'rust', 'c', 'cpp', 'lua', 'javascript' }
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'c', 'cpp', 'rust', 'lua' },
|
||||
pattern = { 'c', 'cpp', 'rust', 'lua', 'javascript' },
|
||||
callback = function()
|
||||
vim.treesitter.start()
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
@@ -28,15 +34,9 @@ vim.api.nvim_create_autocmd('FileType', {
|
||||
})
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
nix = { "alejandra" },
|
||||
-- Conform will run multiple formatters sequentially
|
||||
-- You can customize some of the format options for the filetype (:help conform.format)
|
||||
rust = { "rustfmt", lsp_format = "fallback" },
|
||||
-- Conform will run the first available formatter
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
-- -- Use a "*" to run formatters on all filetypes
|
||||
["*"] = { "codespell" },
|
||||
-- Use "_" to run formatters on filetypes that don't have other formatters
|
||||
lua = { "emmylua-codeformat", lsp_format = "fallback" },
|
||||
javascript = { "denols", stop_after_first = true },
|
||||
["_"] = { "trim_whitespace" },
|
||||
},
|
||||
format_on_save = {
|
||||
@@ -45,7 +45,7 @@ require("conform").setup({
|
||||
},
|
||||
})
|
||||
|
||||
require('colorizer').setup()
|
||||
require('nvim-highlight-colors').turnOn()
|
||||
require("Polydev").setup({
|
||||
terminal = {
|
||||
mode = "split",
|
||||
@@ -92,6 +92,25 @@ require("fzf-lua").setup({
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
vim.lsp.config("lua_ls", {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable({ "lua_ls", "clangd", "rust-analyzer", "denols" })
|
||||
|
||||
--- Options
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
@@ -118,48 +137,30 @@ vim.opt.cursorlineopt = { "screenline", "number" } -- cursorline look
|
||||
vim.opt.foldmethod = "indent"
|
||||
vim.opt.foldcolumn = "1"
|
||||
vim.opt.foldenable = false
|
||||
vim.opt.shortmess = 'aF' -- abbreviates messages and prevents file name being echoed when opened
|
||||
vim.opt.ignorecase = true -- ignore cases when searching
|
||||
vim.opt.smartcase = true -- However if we use a capital in search string we then consider case-sensitivity, ignorecase is disabled
|
||||
vim.opt.smartindent = true -- smarter indentation
|
||||
vim.opt.smarttab = true -- make tab behaviour smarter
|
||||
vim.opt.shortmess = 'aF' -- abbreviates messages and prevents file name being echoed when opened
|
||||
vim.opt.ignorecase = true -- ignore cases when searching
|
||||
vim.opt.smartcase = true -- However if we use a capital in search string we then consider case-sensitivity, ignorecase is disabled
|
||||
vim.opt.smartindent = false -- smarter indentation
|
||||
vim.opt.smarttab = true -- make tab behaviour smarter
|
||||
vim.opt.laststatus = 3
|
||||
-- vim.opt.list = true
|
||||
|
||||
-- vim.opt.lcs = "tab:| "
|
||||
-- vim.opt.colorcolumn= "80"
|
||||
--- COLORS
|
||||
|
||||
vim.cmd.colorscheme("rose-pine")
|
||||
-- vim.cmd.colorscheme("tokyonight-moon")
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
|
||||
-- 2. Customize the built-in lua_ls config
|
||||
vim.lsp.config("lua_ls", {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.lsp.enable({ "lua_ls", "clangd", "rust-analyzer", "nil_ls" })
|
||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "NormalFloat", { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(0, "StatusLine", { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(0, "StatusLineTerm", { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(0, "StatusLineNC", { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(0, "SignColumn", { link = 'Normal' })
|
||||
-- vim.api.nvim_set_hl(0, 'LineNrAbove', { link = 'Conceal', bold = true })
|
||||
-- vim.api.nvim_set_hl(0, 'LineNrBelow', { link = 'Conceal', bold = true })
|
||||
vim.api.nvim_set_hl(0, 'LineNrAbove', { link = 'NonText', bold = true })
|
||||
vim.api.nvim_set_hl(0, 'LineNrBelow', { link = 'NonText', bold = true })
|
||||
vim.api.nvim_set_hl(0, "LineNr", { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(0, "FoldColumn", { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(0, "CursorLineNr", { bg = "none", link = 'MatchParen', bold = true })
|
||||
|
||||
--- KEYMAPS
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
vim.keymap.set("n", "<leader>ff", vim.lsp.buf.format)
|
||||
@@ -168,12 +169,14 @@ vim.keymap.set("n", "<leader>ss", ":split<CR>")
|
||||
vim.keymap.set("n", "<leader>E", ":Ex<CR>")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
vim.keymap.set("x", "<leader>p", [["_dP]])
|
||||
vim.keymap.set('n', '<leader><leader>', ":FzfLua files<CR>")
|
||||
vim.keymap.set('n', '<leader>fh', ":FzfLua helptags<CR>")
|
||||
vim.keymap.set('n', '<leader>fg', ":FzfLua live_grep<CR>")
|
||||
vim.keymap.set('n', '<leader>fm', ":FzfLua manpages<CR>")
|
||||
vim.keymap.set('n', '<leader>xx', ":FzfLua diagnostics_workspace<CR>")
|
||||
vim.keymap.set('n', '<leader>xx', vim.diagnostic.setqflist)
|
||||
vim.keymap.set('n', '<leader>fs', vim.lsp.buf.document_symbol)
|
||||
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.definition)
|
||||
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references)
|
||||
@@ -190,4 +193,3 @@ vim.keymap.set("n", "<C-h>", ":NvimTmuxNavigateLeft<CR>", { silent = true })
|
||||
vim.keymap.set("n", "<C-j>", ":NvimTmuxNavigateDown<CR>", { silent = true })
|
||||
vim.keymap.set("n", "<C-k>", ":NvimTmuxNavigateUp<CR>", { silent = true })
|
||||
vim.keymap.set("n", "<C-l>", ":NvimTmuxNavigateRight<CR>", { silent = true })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user