mirror of
https://github.com/pnx/dotfiles
synced 2026-06-17 11:30:02 +02:00
touched the nvim, alot.
This commit is contained in:
parent
4c1b128c96
commit
13e4207ef5
28 changed files with 288 additions and 145 deletions
13
nvim/lua/config/commands.lua
Normal file
13
nvim/lua/config/commands.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
-- Nice command that creates all directores in the path
|
||||
-- then creates the file and opens it.
|
||||
vim.api.nvim_create_user_command('CreateFile',
|
||||
function(opts)
|
||||
local dir = vim.fs.dirname(opts.fargs[1])
|
||||
vim.cmd(string.format("!mkdir -p %s\n !touch %s", dir, opts.fargs[1]))
|
||||
vim.cmd.e(opts.fargs)
|
||||
end,
|
||||
{ nargs = 1, complete = "file" }
|
||||
)
|
||||
|
||||
vim.cmd("ca cf CreateFile")
|
||||
|
|
@ -32,3 +32,4 @@ autocmd('Filetype', {
|
|||
pattern = 'php',
|
||||
command = 'setlocal commentstring=//\\%s'
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -4,37 +4,35 @@ return {
|
|||
selected = '',
|
||||
close = '✖',
|
||||
pinned = '',
|
||||
folder = {
|
||||
closed = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
},
|
||||
diff = {
|
||||
added = '',
|
||||
modified = '',
|
||||
removed = '',
|
||||
},
|
||||
filetree = {
|
||||
basic = {
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
folder_empty = "",
|
||||
},
|
||||
git = {
|
||||
-- Change type
|
||||
added = "",
|
||||
modified = "",
|
||||
deleted = "✖",
|
||||
renamed = "",
|
||||
-- Status type
|
||||
untracked = "",
|
||||
ignored = "",
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
diff_gutter = {
|
||||
add = '▌',
|
||||
change = '▌',
|
||||
add = '▍',
|
||||
change = '▍',
|
||||
delete = '',
|
||||
untracked = '+'
|
||||
},
|
||||
gitsigns = {
|
||||
-- Change type
|
||||
added = "",
|
||||
modified = "",
|
||||
deleted = "✖",
|
||||
renamed = "",
|
||||
-- Status type
|
||||
untracked = "",
|
||||
ignored = "",
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
conflict = "",
|
||||
},
|
||||
diagnostics = {
|
||||
error = '',
|
||||
warn = '',
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
require("config.settings")
|
||||
require("config.mappings")
|
||||
require("config.filetype")
|
||||
require("config.commands")
|
||||
|
|
|
|||
|
|
@ -53,6 +53,6 @@ map("n", "<leader>rw", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], {
|
|||
map("n", "Q", "<nop>")
|
||||
|
||||
-- diagnostics
|
||||
map("n", "<leader>DD", vim.diagnostic.open_float, { desc = "Open"})
|
||||
map("n", "<leader>Dn", vim.diagnostic.get_next, { desc = "Open"})
|
||||
map("n", "<leader>Dp", vim.diagnostic.get_prev, { desc = "Open"})
|
||||
map("n", "<leader>do", vim.diagnostic.open_float, { desc = "Open diagnostics"})
|
||||
map("n", "<leader>dn", vim.diagnostic.get_next, { desc = "Goto next"})
|
||||
map("n", "<leader>dp", vim.diagnostic.get_prev, { desc = "Goto previous"})
|
||||
|
|
|
|||
|
|
@ -2,11 +2,13 @@ return {
|
|||
flavour = "mocha",
|
||||
color_overrides = {
|
||||
mocha = {
|
||||
base = '#0E1019',
|
||||
base = '#0e1019',
|
||||
mantle = '#131521',
|
||||
text = '#ECEEF4',
|
||||
text = '#eceef4',
|
||||
}
|
||||
},
|
||||
no_italic = true,
|
||||
no_bold = true,
|
||||
highlight_overrides = {
|
||||
mocha = function(colors)
|
||||
return {
|
||||
|
|
@ -16,34 +18,46 @@ return {
|
|||
IblScope = { fg = colors.overlay2 },
|
||||
|
||||
BufferCurrent = { fg = colors.text, bg = colors.base },
|
||||
-- BufferInactive = { bg=colors.base},
|
||||
-- BufferOffset = { bg = colors.mantle },
|
||||
-- BufferTabpageFill = {bg=colors.base},
|
||||
-- Bufferbar
|
||||
BufferCurrentMod = { fg = colors.yellow, bg = colors.base },
|
||||
BufferCurrentADDED = { fg = colors.green, bg = colors.base },
|
||||
BufferCurrentCHANGED = { fg = colors.yellow, bg = colors.base },
|
||||
BufferCurrentDELETED = { fg = colors.red, bg = colors.base },
|
||||
|
||||
-- LSP
|
||||
LspReferenceText = { bg = colors.surface0 },
|
||||
LspReferenceRead = { link = "LspReferenceText" },
|
||||
LspReferenceWrite = { link = "LspReferenceText" },
|
||||
|
||||
-- Syntax
|
||||
Operator = { link = "@text" },
|
||||
PreProc = { link = "Include" },
|
||||
Operator = { fg = colors.rosewater },
|
||||
Function = { link = "@text" },
|
||||
Delimiter = { link = "@text" },
|
||||
Include = { fg = colors.yellow },
|
||||
Include = { fg = colors.mauve },
|
||||
Keyword = { fg = colors.yellow },
|
||||
Repeat = { link = "Keyword" },
|
||||
Conditional = { link = "Keyword" },
|
||||
Type = { fg = colors.blue },
|
||||
String = { fg = colors.lavender },
|
||||
Exception = { link = "Keyword" },
|
||||
["@constructor"] = { link = "Function" },
|
||||
["@variable"] = { fg = colors.green },
|
||||
["@variable.builtin"] = { link = "@variable" },
|
||||
["@variable.parameter"] = { link = "@variable" },
|
||||
["@variable.parameter"] = { link = "@parameter" },
|
||||
["@variable.member"] = { link = "@variable" },
|
||||
["@parameter"] = { link = "@variable" },
|
||||
["@keyword.function"] = { link = "Keyword" },
|
||||
["@keyword.return"] = { link = "Keyword" },
|
||||
["@keyword.operator"] = { link = "Keyword" },
|
||||
["@property"] = { link = "@variable" },
|
||||
["@tag"] = { link = "Keyword" },
|
||||
["@tag.delimiter"] = { link = "@text" },
|
||||
["@punctuation"] = { link = "@text" },
|
||||
["@module"] = { link = "@text" },
|
||||
["@punctuation.bracket"] = { link = "@punctuation" },
|
||||
["@lsp.type.property"] = { link = "@variable" },
|
||||
|
||||
-- PHP specific
|
||||
["@class_name.php"] = { link = "@text" },
|
||||
["@extend_name.php"] = { link = "@text" },
|
||||
["@implements_name.php"] = { link = "@text" },
|
||||
18
nvim/lua/config/plugins/conform.lua
Normal file
18
nvim/lua/config/plugins/conform.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
keys = {
|
||||
{ '<leader>ff', "<cmd>Format<cr>", desc = 'Format file' },
|
||||
{ '<leader>ff', "<cmd>Format<cr>", mode = 'x', desc = 'Format selection' },
|
||||
},
|
||||
opts = {
|
||||
format_options = {
|
||||
async = true,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
notify_on_error = true,
|
||||
formatters_by_ft = {
|
||||
blade = { "blade-formatter" },
|
||||
lua = { "stylua" },
|
||||
["_"] = { "prettier" }
|
||||
}
|
||||
}
|
||||
}
|
||||
7
nvim/lua/config/plugins/laravel.lua
Normal file
7
nvim/lua/config/plugins/laravel.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
keys = {
|
||||
["<leader>la"] = { ":Laravel artisan<cr>", "Run artisan" },
|
||||
["<leader>lr"] = { ":Laravel routes<cr>", "Search routes" },
|
||||
["<leader>lm"] = { ":Laravel related<cr>", "Related" },
|
||||
},
|
||||
}
|
||||
45
nvim/lua/config/plugins/telescope.lua
Normal file
45
nvim/lua/config/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
local icons = require('config.icons')
|
||||
|
||||
return {
|
||||
key_groups = {
|
||||
["<leader>s"] = { name = "+search" },
|
||||
},
|
||||
keys = {
|
||||
{ '<leader>sf', '<cmd>Telescope find_files<cr>', desc = 'Search files' },
|
||||
{ '<leader>sa', '<cmd>Telescope live_grep<cr>', desc = 'Search in files' },
|
||||
{ '<leader>sg', '<cmd>Telescope git_files<cr>', desc = 'Search Git files' },
|
||||
{ '<leader>so', '<cmd>Telescope oldfiles<cr>', desc = 'Search Old files' },
|
||||
{ '<leader>sw', '<cmd>Telescope grep_string<cr>', desc = 'Search for word under cursor' },
|
||||
-- LSP
|
||||
{ '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' },
|
||||
{ '<leader>ss', '<cmd>Telescope lsp_document_symbols<cr>', desc = 'Search document symbols' },
|
||||
{ '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' },
|
||||
{ 'gd', '<cmd>Telescope lsp_definitions<cr>', desc = 'Goto definition' },
|
||||
},
|
||||
opts = function()
|
||||
local actions = require("telescope.actions")
|
||||
return {
|
||||
defaults = {
|
||||
path_display = { truncate = 1 },
|
||||
prompt_prefix = ' ',
|
||||
selection_caret = icons.current .. ' ',
|
||||
multi_icon = icons.selected .. ' ',
|
||||
file_ignore_patterns = {
|
||||
".git/",
|
||||
"node_modules/"
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = actions.close
|
||||
}
|
||||
}
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
return {
|
||||
{ '<leader>sf', '<cmd>Telescope find_files<cr>', desc = 'Search files' },
|
||||
{ '<leader>sa', '<cmd>Telescope live_grep<cr>', desc = 'Search in files' },
|
||||
{ '<leader>sg', '<cmd>Telescope git_files<cr>', desc = 'Search Git files' },
|
||||
{ '<leader>so', '<cmd>Telescope oldfiles<cr>', desc = 'Search Old files' },
|
||||
{ '<leader>sw', '<cmd>Telescope grep_string<cr>', desc = 'Search for word under cursor' },
|
||||
-- LSP
|
||||
{ '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' },
|
||||
{ '<leader>ss', '<cmd>Telescope lsp_document_symbols<cr>', desc = 'Search document symbols' },
|
||||
{ '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' },
|
||||
{ 'gd', '<cmd>Telescope lsp_definitions<cr>', desc = 'Goto definition' },
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue