Skip to content

Commit 59fa9c7

Browse files
committed
chore: save config
1 parent cb2ff35 commit 59fa9c7

File tree

9 files changed

+128
-90
lines changed

9 files changed

+128
-90
lines changed

init.lua

Lines changed: 37 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ require('lazy').setup({
7171
'tpope/vim-fugitive',
7272
'tpope/vim-rhubarb',
7373

74+
7475
-- Detect tabstop and shiftwidth automatically
7576
'tpope/vim-sleuth',
7677

@@ -149,35 +150,13 @@ require('lazy').setup({
149150
'lukas-reineke/indent-blankline.nvim',
150151
-- Enable `lukas-reineke/indent-blankline.nvim`
151152
-- See `:help indent_blankline.txt`
152-
opts = {
153-
char = '',
154-
show_trailing_blankline_indent = false,
155-
},
153+
main = 'ibl',
154+
opts = {},
156155
},
157156

158157
-- "gc" to comment visual regions/lines
159158
{ 'numToStr/Comment.nvim', opts = {} },
160159

161-
-- Fuzzy Finder (files, lsp, etc)
162-
{
163-
'nvim-telescope/telescope.nvim',
164-
branch = '0.1.x',
165-
dependencies = {
166-
'nvim-lua/plenary.nvim',
167-
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
168-
-- Only load if `make` is available. Make sure you have the system
169-
-- requirements installed.
170-
{
171-
'nvim-telescope/telescope-fzf-native.nvim',
172-
-- NOTE: If you are having trouble with this installation,
173-
-- refer to the README for telescope-fzf-native for more instructions.
174-
build = 'make',
175-
cond = function()
176-
return vim.fn.executable 'make' == 1
177-
end,
178-
},
179-
},
180-
},
181160
{
182161
-- Highlight, edit, and navigate code
183162
'nvim-treesitter/nvim-treesitter',
@@ -239,7 +218,7 @@ vim.o.smartcase = true
239218
vim.wo.signcolumn = 'yes'
240219

241220
-- Decrease update time
242-
vim.o.updatetime = 250
221+
vim.o.updatetime = 100
243222
vim.o.timeoutlen = 300
244223

245224
-- Set completeopt to have a better completion experience
@@ -277,49 +256,18 @@ vim.api.nvim_create_autocmd("BufWritePre", {
277256
end
278257
})
279258

280-
-- [[ Configure Telescope ]]
281-
-- See `:help telescope` and `:help telescope.setup()`
282-
require('telescope').setup {
283-
defaults = {
284-
mappings = {
285-
i = {
286-
['<C-u>'] = false,
287-
['<C-d>'] = false,
288-
},
289-
},
259+
vim.filetype.add({
260+
extension = {
261+
arb = "json",
290262
},
291-
}
292-
293-
-- Enable telescope fzf native, if installed
294-
pcall(require('telescope').load_extension, 'fzf')
295-
296-
-- See `:help telescope.builtin`
297-
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
298-
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
299-
vim.keymap.set('n', '<leader>/', function()
300-
-- You can pass additional configuration to telescope to change theme, layout, etc.
301-
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
302-
winblend = 10,
303-
previewer = false,
304-
})
305-
end, { desc = '[/] Fuzzily search in current buffer' })
306-
307-
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
308-
vim.keymap.set('n', '<leader>gs', require('telescope.builtin').git_status, { desc = 'Search [G]it [S]tatus' })
309-
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
310-
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
311-
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
312-
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
313-
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
314-
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
315-
263+
})
316264

317265
-- [[ Configure Treesitter ]]
318266
-- See `:help nvim-treesitter`
319267
require('nvim-treesitter.configs').setup {
320268
-- Add languages to be installed here that you want installed for treesitter
321269
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim',
322-
'dart', 'prisma', 'graphql' },
270+
'dart', 'prisma', 'graphql', 'json' },
323271

324272
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
325273
auto_install = false,
@@ -396,6 +344,7 @@ vim.keymap.set("n", "<leader>n", '<Cmd>bnext<CR>', { desc = "[N]ext buffer" })
396344
vim.keymap.set("n", "<leader>p", '<Cmd>bprevious<CR>', { desc = "[P]revious buffer" })
397345
vim.keymap.set("n", "<leader>d", '<Cmd>bdelete<CR>', { desc = "[D]elete buffer" })
398346
vim.keymap.set("n", "<leader>ot", "<Cmd>20split | te<CR>", { desc = "[O]pen [T]erminal below" })
347+
vim.keymap.set("n", "<leader>vs", "<Cmd>vs<CR>", { desc = "[V]ertical [S]plit" })
399348

400349
-- Save file
401350
vim.keymap.set("n", "<leader>s", '<Cmd>w<CR>', { desc = "[S]ave file" })
@@ -462,6 +411,7 @@ local servers = {
462411
tsserver = {},
463412
prismals = {},
464413
graphql = {},
414+
clangd = {},
465415
-- prettierd = {},
466416
-- html = { filetypes = { 'html', 'twig', 'hbs'} }
467417
lua_ls = {
@@ -519,14 +469,15 @@ vim.api.nvim_create_autocmd('LspAttach', {
519469

520470
-- Ensure the servers above are installed
521471
local mason_lspconfig = require 'mason-lspconfig'
472+
local lspconfig = require('lspconfig')
522473

523474
mason_lspconfig.setup {
524475
ensure_installed = vim.tbl_keys(servers),
525476
}
526477

527478
mason_lspconfig.setup_handlers {
528479
function(server_name)
529-
require('lspconfig')[server_name].setup {
480+
lspconfig[server_name].setup {
530481
capabilities = capabilities,
531482
on_attach = on_attach,
532483
settings = servers[server_name],
@@ -535,32 +486,26 @@ mason_lspconfig.setup_handlers {
535486
end
536487
}
537488

538-
539-
-- Setup language servers.
540-
local lspconfig = require('lspconfig')
541-
542489
capabilities.textDocument.completion.completionItem.snippetSupport = true
543-
lspconfig.dartls.setup({
544-
cmd = { "dart", "language-server", "--protocol=lsp" },
545-
filetypes = { "dart" },
546-
init_options = {
547-
closingLabels = true,
548-
flutterOutline = true,
549-
onlyAnalyzeProjectsWithOpenFiles = true,
550-
outline = true,
551-
suggestFromUnimportedLibraries = true,
552-
},
553-
capabilities = capabilities,
554-
-- root_dir = root_pattern("pubspec.yaml"),
555-
settings = {
556-
dart = {
557-
completeFunctionCalls = true,
558-
showTodos = true,
559-
},
560-
},
561-
})
562-
563-
require("telescope").load_extension("flutter")
490+
-- lspconfig.dartls.setup({
491+
-- cmd = { "dart", "language-server", "--protocol=lsp" },
492+
-- filetypes = { "dart" },
493+
-- init_options = {
494+
-- closingLabels = true,
495+
-- flutterOutline = true,
496+
-- onlyAnalyzeProjectsWithOpenFiles = true,
497+
-- outline = true,
498+
-- suggestFromUnimportedLibraries = true,
499+
-- },
500+
-- capabilities = capabilities,
501+
-- -- root_dir = root_pattern("pubspec.yaml"),
502+
-- settings = {
503+
-- dart = {
504+
-- completeFunctionCalls = true,
505+
-- showTodos = true,
506+
-- },
507+
-- },
508+
-- })
564509

565510
-- [[ Configure nvim-cmp ]]
566511
-- See `:help cmp`
@@ -576,10 +521,13 @@ cmp.setup {
576521
luasnip.lsp_expand(args.body)
577522
end,
578523
},
524+
completion = {
525+
completeopt = 'menu,menuone,noinsert',
526+
},
579527
mapping = cmp.mapping.preset.insert {
580528
['<C-n>'] = cmp.mapping.select_next_item(),
581529
['<C-p>'] = cmp.mapping.select_prev_item(),
582-
['<C-d>'] = cmp.mapping.scroll_docs(-4),
530+
['<C-b>'] = cmp.mapping.scroll_docs(-4),
583531
['<C-f>'] = cmp.mapping.scroll_docs(4),
584532
['<C-Space>'] = cmp.mapping.complete {},
585533
['<CR>'] = cmp.mapping.confirm {
@@ -608,6 +556,7 @@ cmp.setup {
608556
sources = {
609557
{ name = 'nvim_lsp' },
610558
{ name = 'luasnip' },
559+
{ name = 'path' },
611560
},
612561
}
613562

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
return {
2+
"asiryk/auto-hlsearch.nvim",
3+
dependencies = { "asiryk/auto-hlsearch.nvim", tag = "1.1.0" },
4+
config = function()
5+
require("auto-hlsearch").setup()
6+
end,
7+
}

lua/custom/plugins/copilot.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ return {
33
init = function()
44
vim.g.copilot_no_tab_map = true
55

6+
vim.api.nvim_set_hl(0, "CopilotSuggestion", { fg = "#83a598", italic = true })
7+
vim.api.nvim_set_hl(0, "CopilotAnnotation", { fg = "#83a598", italic = true })
68
vim.keymap.set("i", "<C-x>", 'copilot#Accept("")', {
79
expr = true,
810
silent = true,

lua/custom/plugins/flutter.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ return {
7171
config.specificThingIDontWant = false
7272
return config
7373
end,
74+
analysisExcludedFolders = { "./fvm/" },
7475
-- see the link below for details on each option:
7576
-- https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/tool/lsp_spec/README.md#client-workspace-configuration
7677
settings = {
7778
showTodos = true,
7879
completeFunctionCalls = true,
7980
renameFilesWithClasses = "prompt", -- "always"
80-
enableSnippets = true,
81+
-- enableSnippets = true,
8182
updateImportsOnRename = true, -- Whether to update imports and other directives when files are renamed. Required for `FlutterRename` command.
8283
}
8384
}
@@ -89,6 +90,11 @@ return {
8990
vim.cmd('te fvm flutter packages pub run build_runner build --delete-conflicting-outputs')
9091
vim.cmd('2sleep | normal G')
9192
end)
93+
vim.keymap.set('n', '<leader>bt', function()
94+
vim.cmd('20new')
95+
vim.cmd('te sh scripts/create_clean_lcov_and_generate_html.sh')
96+
vim.cmd('2sleep | normal G')
97+
end)
9298
-- '<Cmd>20new | te fvm flutter pub get && fvm flutter packages pub run build_runner build --delete-conflicting-outputs<CR> | $')
9399
end
94100
};

lua/custom/plugins/telescope.lua

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
return {
2+
'nvim-telescope/telescope.nvim',
3+
tag = '0.1.5',
4+
dependencies = {
5+
'nvim-lua/plenary.nvim',
6+
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
7+
-- Only load if `make` is available. Make sure you have the system
8+
-- requirements installed.
9+
{
10+
'nvim-telescope/telescope-fzf-native.nvim',
11+
-- NOTE: If you are having trouble with this installation,
12+
-- refer to the README for telescope-fzf-native for more instructions.
13+
build = 'make',
14+
cond = function()
15+
return vim.fn.executable 'make' == 1
16+
end,
17+
},
18+
},
19+
config = function()
20+
require('telescope').setup {
21+
defaults = {
22+
mappings = {
23+
i = {
24+
['<C-u>'] = false,
25+
['<C-d>'] = false,
26+
},
27+
},
28+
},
29+
}
30+
31+
-- Enable telescope fzf native, if installed
32+
pcall(require('telescope').load_extension, 'fzf')
33+
pcall(require('telescope').load_extension, 'flutter')
34+
35+
-- See `:help telescope.builtin`
36+
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
37+
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
38+
vim.keymap.set('n', '<leader>/', function()
39+
-- You can pass additional configuration to telescope to change theme, layout, etc.
40+
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
41+
winblend = 10,
42+
previewer = false,
43+
})
44+
end, { desc = '[/] Fuzzily search in current buffer' })
45+
46+
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
47+
vim.keymap.set('n', '<leader>gs', require('telescope.builtin').git_status, { desc = 'Search [G]it [S]tatus' })
48+
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
49+
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
50+
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
51+
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
52+
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
53+
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
54+
end
55+
}

lua/custom/plugins/tests.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,19 @@ return {
1818
},
1919
},
2020
})
21+
22+
local neotest = require('neotest')
23+
24+
vim.keymap.set('n', '<leader>tu', function()
25+
neotest.summary.toggle()
26+
end, { desc = 'Test: [T]oggle [S]ummary unit tests' })
27+
vim.keymap.set('n', '<leader>to', function()
28+
neotest.output.open()
29+
end, { desc = 'Test: [T]oggle [O]utput' })
30+
31+
32+
vim.keymap.set('n', '<leader>rt', function()
33+
neotest.run.run()
34+
end, { desc = 'Test: [R]un [T]ests' })
2135
end
2236
}

lua/custom/plugins/tree.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ return {
123123
commands = {},
124124
window = {
125125
position = "left",
126-
width = 40,
126+
width = 60,
127127
mapping_options = {
128128
noremap = true,
129129
nowait = true,

lua/kickstart/plugins/debug.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ return {
5353
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
5454
end, { desc = 'Debug: Set Breakpoint' })
5555

56+
5657
-- Dap UI setup
5758
-- For more information, see |:help nvim-dap-ui|
5859
dapui.setup {

snippets/dart.snippets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@
88
#
99
snippet tmt "Theme textTheme"
1010
Theme.of(context).textTheme.$1
11+
snippet phr "AppLocalizations"
12+
AppLocalizations.of(context)!.$1
13+
snippet imploc "Import AppLocalizations"
14+
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

0 commit comments

Comments
 (0)