This commit is contained in:
fz0x1 2024-09-29 16:08:33 +02:00
parent 9de3a488a7
commit dff4d40b46
9 changed files with 79 additions and 104 deletions

View file

@ -1,19 +1,3 @@
-- local helpers = require("core.helpers")
-- auto-format on save
-- local lsp_fmt_group = vim.api.nvim_create_augroup("LspFormattingGroup", {})
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- group = lsp_fmt_group,
-- callback = function()
-- local efm = vim.lsp.get_clients({ name = "efm" })
--
-- if vim.tbl_isempty(efm) then
-- return
-- end
--
-- vim.lsp.buf.format({ name = "efm", async = true })
-- end,
-- })
-- highlight on yank
local highlight_yank_group = vim.api.nvim_create_augroup("HighlightYankGroup", {})
vim.api.nvim_create_autocmd("TextYankPost", {

View file

@ -12,14 +12,14 @@ mapkey("<leader>m", "NvimTreeFocus", "n")
mapkey("<leader>e", "NvimTreeToggle", "n")
-- Pane and Window Navigation
mapkey("<C-h>", "<C-w>h", "n") -- Navigate Left
mapkey("<C-j>", "<C-w>j", "n") -- Navigate Down
mapkey("<C-k>", "<C-w>k", "n") -- Navigate Up
mapkey("<C-l>", "<C-w>l", "n") -- Navigate Right
mapkey("<C-h>", "wincmd h", "t") -- Navigate Left
mapkey("<C-j>", "wincmd j", "t") -- Navigate Down
mapkey("<C-k>", "wincmd k", "t") -- Navigate Up
mapkey("<C-l>", "wincmd l", "t") -- Navigate Right
-- mapkey("<C-h>", "<C-w>h", "n") -- Navigate Left
-- mapkey("<C-j>", "<C-w>j", "n") -- Navigate Down
-- mapkey("<C-k>", "<C-w>k", "n") -- Navigate Up
-- mapkey("<C-l>", "<C-w>l", "n") -- Navigate Right
-- mapkey("<C-h>", "wincmd h", "t") -- Navigate Left
-- mapkey("<C-j>", "wincmd j", "t") -- Navigate Down
-- mapkey("<C-k>", "wincmd k", "t") -- Navigate Up
-- mapkey("<C-l>", "wincmd l", "t") -- Navigate Right
mapkey("<C-h>", "TmuxNavigateLeft", "n") -- Navigate Left
mapkey("<C-j>", "TmuxNavigateDown", "n") -- Navigate Down
mapkey("<C-k>", "TmuxNavigateUp", "n") -- Navigate Up
@ -36,24 +36,12 @@ mapkey("<C-Right>", "vertical resize -2", "n")
-- Show Full File-Path
mapkey("<leader>pa", "echo expand('%:p')", "n") -- Show Full File Path
-- Notes
-- mapkey("<leader>ng", "Neorg workspace general", "n")
-- mapkey("<leader>nw", "Neorg workspace work", "n")
-- mapkey("<leader>ny", "Neorg workspace youtube", "n")
-- Indenting
vim.keymap.set("v", "<", "<gv", { silent = true, noremap = true })
vim.keymap.set("v", ">", ">gv", { silent = true, noremap = true })
local api = vim.api
-- Zen Mode
-- api.nvim_set_keymap("n", "<leader>zn", ":TZNarrow<CR>", {})
-- api.nvim_set_keymap("v", "<leader>zn", ":'<,'>TZNarrow<CR>", {})
-- api.nvim_set_keymap("n", "<leader>sm", ":TZFocus<CR>", {})
-- api.nvim_set_keymap("n", "<leader>zm", ":TZMinimalist<CR>", {})
-- api.nvim_set_keymap("n", "<leader>za", ":TZAtaraxis<CR>", {})
-- Comments
api.nvim_set_keymap("n", "<C-_>", "gtc", { noremap = false })
api.nvim_set_keymap("v", "<C-_>", "goc", { noremap = false })

View file

@ -8,16 +8,19 @@ opt.tabstop = 2
opt.shiftwidth = 2
opt.softtabstop = 2
opt.expandtab = true
opt.autoindent = true
opt.smartindent = true
opt.wrap = false
opt.shiftwidth = 2
-- Search
opt.incsearch = true
opt.ignorecase = true
opt.smartcase = true
opt.hlsearch = false
opt.hlsearch = true
-- Appearance
opt.title = true
opt.number = true
opt.relativenumber = false
opt.termguicolors = true
@ -32,9 +35,24 @@ opt.showmode = false
-- opt.tabline = '%!v:lua.require("utils").tabline()'
opt.conceallevel = 2
opt.breakindent = true
opt.breakindentopt = "shift:2"
-- Behaviour
vim.opt.wildignore:append({
"*/node_modules/*",
"*.o",
"*.a",
"*.class",
"*.pyc",
"*/.git/*",
"*/dist/*",
"*/venv/*",
"*/__pycache__/*",
})
opt.splitkeep = "cursor"
opt.shell = "zsh"
opt.showcmd = true
opt.laststatus = 2
opt.expandtab = true
opt.hidden = true
opt.errorbells = false
opt.swapfile = false
@ -46,12 +64,13 @@ opt.splitright = true
opt.splitbelow = true
opt.autochdir = false
opt.iskeyword:append("-")
opt.mouse:append("a")
opt.mouse = ""
opt.clipboard:append("unnamedplus")
opt.modifiable = true
-- opt.guicursor =
-- "n-v-c:block,i-ci-ve:block,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175"
opt.encoding = "UTF-8"
opt.fileencoding = "utf-8"
opt.cursorline = false
-- spell

View file

@ -2,7 +2,7 @@ local config = {
options = {
icons_enabled = true,
theme = "auto",
globalstatus = true,
globalstatus = false,
disabled_filetypes = {
statusline = {},
winbar = {},
@ -19,46 +19,54 @@ local config = {
sections = {
lualine_a = { "mode" },
lualine_b = { "" },
lualine_x = { "diagnostics", "encoding", "fileformat", "filetype" },
lualine_x = { "diagnostics", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
lualine_c = {},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
}
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
-- local function ins_left(component)
-- table.insert(config.sections.lualine_c, component)
-- end
local function ins_right(component)
table.insert(config.sections.lualine_x, 1, component)
end
-- local function ins_right(component)
-- table.insert(config.sections.lualine_x, 1, component)
-- end
ins_right({
-- Lsp server name .
function()
local msg = "No Active Lsp"
-- local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
local buf_ft = vim.bo.filetype
local clients = vim.lsp.get_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end,
icon = " LSP:",
color = { fg = "#ff6b6b" },
})
-- ins_right({
-- -- Lsp server name .
-- function()
-- local msg = "No Active Lsp"
-- -- local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
-- local buf_ft = vim.bo.filetype
-- local clients = vim.lsp.get_clients()
-- if next(clients) == nil then
-- return msg
-- end
-- for _, client in ipairs(clients) do
-- local filetypes = client.config.filetypes
-- if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
-- return client.name
-- end
-- end
-- return msg
-- end,
-- icon = " LSP:",
-- color = { fg = "#ff6b6b" },
-- })
return {
"nvim-lualine/lualine.nvim",

View file

@ -1,3 +1,4 @@
-- TODO what is it for lol?
return {
"godlygeek/tabular",
lazy = false,

View file

@ -1,3 +1,4 @@
-- TODO need to test
return {
"preservim/tagbar",
lazy = false,

View file

@ -1,26 +0,0 @@
local M = {}
function M.tabline()
local s = ""
for i = 1, vim.fn.tabpagenr("$") do
local winnr = vim.fn.tabpagewinnr(i)
local buflist = vim.fn.tabpagebuflist(i)
local bufnr = buflist[winnr]
local bufname = vim.fn.bufname(bufnr)
local filename = vim.fn.fnamemodify(bufname, ":t")
local icon = require("nvim-web-devicons").get_icon(filename)
-- Отмечаем активный таб
if i == vim.fn.tabpagenr() then
s = s .. "%#TabLineSel#"
else
s = s .. "%#TabLine#"
end
s = s .. " " .. (icon or "") .. " " .. filename .. " "
end
s = s .. "%#TabLineFill#%="
return s
end
return M