Skip to content

Commit f5a94e2

Browse files
authored
Merge pull request #7 from kbarioi/main
arst
2 parents 0d02616 + 13de9a0 commit f5a94e2

File tree

7 files changed

+96
-27
lines changed

7 files changed

+96
-27
lines changed

after/plugin/colors.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
vim.g.tokyonight_style = "night"
2-
vim.cmd("colorscheme tokyonight")
1+
-- vim.g.tokyonight_style = "night"
2+
vim.cmd("colorscheme catppuccin")

after/plugin/mason.lua

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
local clients = require('kbario.clients')
22
local clients_to_install = {}
33
for client, config in pairs(clients) do
4-
if config then
4+
if config and client ~= "rust_analyzer" then
55
table.insert(clients_to_install, client)
66
end
7-
87
end
98

109
require("mason").setup()
@@ -13,10 +12,9 @@ require("mason-lspconfig").setup({
1312
})
1413

1514
require("mason-null-ls").setup({
16-
automatic_setup = true,
17-
ensure_installed = {
18-
"sqlfluff", "sql_formatter", "stylua", "codespell", "prettier", "prettierd", "eslint_d"
19-
}
15+
automatic_setup = true,
16+
ensure_installed = {
17+
"sqlfluff", "sql_formatter", "stylua", "codespell", "prettier", "prettierd", "eslint_d"
18+
}
2019
})
2120
require("null-ls").setup()
22-
require 'mason-null-ls'.setup_handlers()

after/plugin/remaps/angular.lua

+45-18
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,53 @@ local Remap = require("kbario.keymap")
44
local nnoremap = Remap.nnoremap
55

66
nnoremap(vim.g.mapleader .. hr.l4t .. hr.l4t, function()
7+
-- get current file name which should be the module you wish to add the comp to
78
local module = vim.api.nvim_buf_get_name(0)
8-
-- local module_name = vim.fn.fnamemodify(module, ':p:.:t')
9+
-- -- is standalone?
10+
-- local isStandaloneInput = vim.fn.input("standalone component? y/n > ")
11+
-- local isStandalone
12+
-- if isStandaloneInput == "y" then
13+
-- isStandalone = true
14+
-- else
15+
-- isStandalone = false
16+
-- end
17+
-- -- is in current module or top level?
18+
-- local isInCurrentModuleInput = vim.fn.input("put in current module? (else app module) y/n > ")
19+
-- local isInCurrentModule
20+
-- if isInCurrentModuleInput == "y" then
21+
-- isInCurrentModule = true
22+
-- else
23+
-- isInCurrentModule = false
24+
-- end
25+
-- get the path of the module without the module in it
926
local module_path = vim.fn.fnamemodify(module, ':p:.:h'):gsub('src/app/', ''):gsub('src\\app\\', '')
27+
-- get the module file name
1028
module = vim.fn.fnamemodify(module, ':p:.'):gsub('src/app/', ''):gsub('src\\app\\', '')
11-
29+
-- create a table with possible options for new components
30+
local comp_tbl = {
31+
['p'] = "pipes",
32+
['s'] = "services",
33+
['c'] = "components",
34+
}
35+
-- get the type of component you want - either component, service or pipe
36+
local type = vim.fn.input("file type (c, s, p) > ")
37+
-- get the name of the file
1238
local name = vim.fn.input("file name > ")
13-
14-
local path = vim.fn.input("file path from " .. module_path .. "/ not including name > ")
15-
path = pth:new(string.format('%s/%s/%s', module_path, path, name)).filename
16-
print(':!ng g c ' .. path .. ' -m ' .. module)
17-
vim.cmd(':!ng g c ' .. path .. ' -m ' .. module)
18-
19-
-- local cdub = vim.loop.cwd()
20-
-- local jsbeautifyrc = pth:new(string.format("%s/.jsbeautifyrc.json", cdub))
21-
--
22-
-- local file = pth:new(vim.api.nvim_buf_get_name(0)):make_relative(cdub)
23-
-- local filetype = vim.fn.fnamemodify(file, ":e")
24-
--
25-
-- if jsbeautifyrc:exists() and filetype == "html" then
26-
-- vim.cmd(string.format(":!js-beautify --config %s --replace %s", jsbeautifyrc.filename, file))
27-
-- print("beautified")
28-
-- end
39+
-- check if you want it put in the logical folder based on the component type
40+
local path
41+
local auto_sort = vim.fn.input("automatically file component in logical folder? (else custom) y/n > ")
42+
if auto_sort ~= 'y' and auto_sort ~= 'n' then return print('incorrect input') end
43+
-- if yes then assign path, else ask for the custom path
44+
if auto_sort == 'y' then
45+
path = comp_tbl[type]
46+
else
47+
path = vim.fn.input("file path from " .. module_path .. "/ not including name > ")
48+
end
49+
-- create the path for the new component to go to
50+
local new_comp_path = pth:new(string.format('%s/%s/%s/%s', module_path, path, name, name)).filename
51+
-- print the command
52+
print(string.format(':!ng g %s %s -m %s', type, new_comp_path, module))
53+
-- run the command
54+
-- vim.cmd(string.format(':!ng g %s %s -m %s', type, new_comp_path, module))
2955
end, { desc = "jsbeautifyrc formatting" })
56+

after/plugin/remaps/telescope.lua

+20
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,25 @@ nnoremap("<leader>" .. hr.l1 .. hr.R3, function()
3131
end, { desc = "telescope: live grep" })
3232

3333
nnoremap("<leader>" .. hr.l1 .. hr.r4, function()
34+
require("telescope.builtin").git_status()
35+
end, { desc = "telescope: keymaps" })
36+
37+
nnoremap("<leader>" .. hr.l1 .. hr.r4b, function()
3438
require("telescope.builtin").keymaps()
3539
end, { desc = "telescope: keymaps" })
40+
41+
-- vstask maps
42+
43+
nnoremap("<leader>" .. hr.l0b .. hr.r1, function()
44+
require("telescope").extensions.vstask.tasks()
45+
end, { desc = "vstask: tasks" })
46+
nnoremap("<leader>" .. hr.l0b .. hr.r2, function()
47+
require("telescope").extensions.vstask.inputs()
48+
end, { desc = "vstask: inputs" })
49+
nnoremap("<leader>" .. hr.l0b .. hr.r3, function()
50+
require("telescope").extensions.vstask.history()
51+
end, { desc = "vstask: history" })
52+
nnoremap("<leader>" .. hr.l0b .. hr.r4, function()
53+
require("telescope").extensions.vstask.launch()
54+
end, { desc = "vstask: launch" })
55+

after/plugin/remaps/terminal.lua

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
local tnoremap = require("kbario.keymap").tnoremap
2+
local nnoremap = require("kbario.keymap").nnoremap
3+
local hr = require('homerows.homerows')
24
tnoremap('<Esc>', '<C-\\><C-n>')
5+
nnoremap('<leader><leader>'..hr.l1, function() vim.cmd(":vsplit term://powershell") end)

lua/kbario/clients.lua

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ M = {
2525
jsonls = {},
2626
marksman = false,
2727
omnisharp = {},
28+
powershell_es = {},
2829
prismals = false,
2930
r_language_server = false,
3031
remark_ls = {},

lua/kbario/packer.lua

+20
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ return require('packer').startup(function(use)
2121
-- colours
2222
use 'folke/tokyonight.nvim'
2323
use 'joshdick/onedark.vim'
24+
use { "catppuccin/nvim", as = "catppuccin",
25+
config = function()
26+
require("catppuccin").setup {
27+
flavour = 'macchiato'
28+
}
29+
end
30+
}
2431

2532
-- telescope
2633
use {
@@ -191,6 +198,19 @@ return require('packer').startup(function(use)
191198
end
192199
}
193200

201+
-- vscode port
202+
use {
203+
'EthanJWright/vs-tasks.nvim',
204+
requires = {
205+
'nvim-lua/popup.nvim',
206+
'nvim-lua/plenary.nvim',
207+
'nvim-telescope/telescope.nvim'
208+
},
209+
config = function()
210+
require("vstask").setup()
211+
end
212+
}
213+
194214
-- kbario plugins
195215
use {
196216
"kbario/spear.nvim",

0 commit comments

Comments
 (0)