Update 04.02.2023

This commit is contained in:
Kristofers Solo 2023-02-04 13:52:00 +02:00
parent fb9f1ab0c3
commit b139246879
7 changed files with 64 additions and 42 deletions

View File

@ -62,7 +62,7 @@ vim.api.nvim_create_autocmd({ "InsertEnter" }, {
})
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "c", "cpp", "yaml", "vimwiki", "markdown", "html", "css", "json" },
pattern = { "vimwiki" },
callback = function()
vim.opt_local.ts = 2
vim.opt_local.sw = 2
@ -74,12 +74,20 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
vim.cmd([[
highlight CursorLine ctermbg=White cterm=bold guibg=#222222
highlight CursorColumn ctermbg=White cterm=bold guibg=#222222
autocmd FileType python imap <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "!python3" shellescape(@%, 1)<cr>
autocmd FileType python map <buffer> <C-b> <cmd>w<cr><cmd>exec "!python3" shellescape(@%, 1)<cr>
autocmd FileType rust imap <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "!cargo run"<cr>
autocmd FileType rust map <buffer> <C-b> <cmd>w<cr><cmd>exec "!cargo run"<cr>
autocmd FileType tex imap <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "silent !lualatex %"<cr>
autocmd FileType tex map <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "silent !lualatex %"<cr>
]])
-- Run file
vim.cmd([[
augroup run_file
autocmd FileType python imap <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "!python3 %"<cr>
autocmd FileType python map <buffer> <C-b> <cmd>w<cr><cmd>exec "!python3 %"<cr>
autocmd FileType rust imap <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "!cargo run"<cr>
autocmd FileType rust map <buffer> <C-b> <cmd>w<cr><cmd>exec "!cargo run"<cr>
autocmd FileType tex imap <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "silent !lualatex %"<cr>
autocmd FileType tex map <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "silent !lualatex %"<cr>
autocmd FileType cpp imap <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "!g++ % -o %:r && %:r"<cr>
autocmd FileType cpp map <buffer> <C-b> <cmd>w<cr><cmd>exec "!g++ % -o %:r && %:r"<cr>
augroup end
]])
-- Autocommand that reloads waybar whenever you save the ~/.config/waybar/config file

View File

@ -4,11 +4,11 @@ if not status_ok then
end
colorizer.setup({
filetypes = { "*" },
filetypes = { "html", "css", "js" },
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = true, -- "Name" codes like Blue or blue
names = false, -- "Name" codes like Blue or blue
RRGGBBAA = true, -- #RRGGBBAA hex codes
AARRGGBB = true, -- 0xAARRGGBB hex codes
rgb_fn = true, -- CSS rgb() and rgba() functions
@ -23,13 +23,12 @@ colorizer.setup({
-- parsers can contain values used in |user_default_options|
sass = {
enable = true,
parsers = { css },
parsers = { "css" },
}, -- Enable sass colors
virtualtext = "",
},
-- all the sub-options of filetypes apply to buftypes
buftypes = {},
html = { names = false },
markdown = { names = false },
vimwiki = { names = false },
-- html = { names = true },
-- css = { names = true },
})

View File

@ -5,6 +5,7 @@ local opts = { silent = true }
--Remap space as leader key
keymap("", "<Space>", "<Nop>", opts)
keymap("n", "q", "<Nop>", opts)
vim.g.mapleader = " "
-- Modes
@ -16,6 +17,11 @@ vim.g.mapleader = " "
-- command_mode = "c",
-- Normal --
keymap("n", "<C-d>", "<C-d>zz", opts)
keymap("n", "<C-u>", "<C-u>zz", opts)
keymap("n", "n", "nzzzv", opts)
keymap("n", "N", "Nzzzv", opts)
-- Better window navigation
keymap("n", "<C-h>", "<C-w>h", opts)
keymap("n", "<C-j>", "<C-w>j", opts)

View File

@ -34,7 +34,8 @@ local servers = {
"emmet_ls",
"html",
"jsonls",
"pyright",
-- "pyright",
"jedi_language_server",
"rust_analyzer",
"sumneko_lua",
"taplo",
@ -55,11 +56,12 @@ mason_tool.setup({
"json-lsp",
"lua-language-server",
"marksman",
"pyright",
-- "pyright",
"jedi-language-server",
"rust-analyzer",
"taplo",
"texlab",
-- "typescript-language-server",
"typescript-language-server",
"vim-language-server",
"yaml-language-server",
},
@ -81,10 +83,10 @@ for _, server in pairs(servers) do
opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
end
if server == "pyright" then
local pyright_opts = require("user.mason.settings.pyright")
opts = vim.tbl_deep_extend("force", pyright_opts, opts)
end
-- if server == "jedi_language_server" then
-- local pyright_opts = require("user.mason.settings.jedi")
-- opts = vim.tbl_deep_extend("force", pyright_opts, opts)
-- end
-- if server == "clangd" then
-- local clangd_opts = require("user.mason.settings.clangd")

View File

@ -17,20 +17,33 @@ local diagnostics = null_ls.builtins.diagnostics
null_ls.setup({
debug = false,
sources = {
formatting.prettier.with({
extra_filetypes = { "toml" },
extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote", "--no-bracket-spacing" },
}),
formatting.autopep8,
formatting.stylua,
formatting.beautysh,
formatting.djlint,
formatting.tidy,
formatting.prettier.with({
extra_filetypes = { "toml" },
extra_args = {
"--no-semi",
"--double-quote",
"--no-bracket-spacing",
"--tab-width",
"4",
"--bracket-same-line",
"--html-whitespace-sensitivity",
"strict",
},
}),
formatting.shfmt,
formatting.stylua,
formatting.isort,
formatting.yamlfmt,
diagnostics.cpplint,
diagnostics.luacheck,
diagnostics.pylint,
diagnostics.flake8,
diagnostics.mypy,
diagnostics.zsh,
diagnostics.misspell,
diagnostics.codespell,
},
})
@ -38,17 +51,17 @@ mason_null_ls.setup({
ensure_installed = {
"autopep8",
"beautysh",
"djlint",
"shfmt",
"yamlfmt",
"codespell",
"cpplint",
"djlint",
"flake8",
"gitlint",
"html_lint",
"luacheck",
"misspell",
"pylint",
"mypy",
"html_lint",
"gitlint",
"shfmt",
"yamlfmt",
},
automatic_installation = true,
automatic_setup = true,

View File

@ -1,9 +0,0 @@
return {
settings = {
python = {
analysis = {
typeCheckingMode = "true",
},
},
},
}

View File

@ -105,6 +105,7 @@ return packer.startup(function(use)
use("nvim-treesitter/nvim-treesitter")
use("p00f/nvim-ts-rainbow")
use("mechatroner/rainbow_csv")
use("mtdl9/vim-log-highlighting")
-- Git
use("lewis6991/gitsigns.nvim")
@ -115,6 +116,8 @@ return packer.startup(function(use)
use("jayp0521/mason-nvim-dap.nvim")
use("ravenxrz/DAPInstall.nvim")
use("ThePrimeagen/vim-be-good")
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if PACKER_BOOTSTRAP then