Compare commits

...

207 commits

Author SHA1 Message Date
Pojok Code
76277745b3 enc: update config, add cmp colorfull and cmp RG 2025-08-02 21:41:49 +07:00
Asep Komarudin
20e96da865
Merge pull request #14 from pojokcodeid/v2.5
V2.5
2025-08-02 21:23:07 +07:00
Pojok Code
3f9b73de6a Merge branch 'dev' 2025-08-02 21:06:43 +07:00
Pojok Code
08d228aa17 Merge branch 'dev' into v2.5 2025-08-02 20:56:54 +07:00
Pojok Code
3b30870f04 enc: update patch plugins 2025-08-02 20:19:38 +07:00
Pojok Code
b341ee7246 enc: update config and mappings 2025-07-27 19:05:46 +07:00
Pojok Code
3f3e84aa49 enc: add option nvim-tree or neo-tree 2025-07-22 21:34:50 +07:00
Pojok Code
c29942d4a7 enc: change indent blank line 2025-07-20 21:40:36 +07:00
Pojok Code
aa2f3a49ef enc: update dressing and lsp signature 2025-07-20 21:37:45 +07:00
Pojok Code
1bdac09f77 enc:add lsp signature help 2025-07-19 19:59:14 +07:00
Pojok Code
4b9382146f enc: add usercommand enable disable codeium 2025-07-19 09:23:29 +07:00
Pojok Code
6d87fbb90a enc: add colorfull cmp, add new simple icon, enhance odeium config 2025-07-18 22:23:07 +07:00
Pojok Code
be2518be72 enc: add new lspkind icons 2025-07-14 23:25:06 +07:00
Pojok Code
4baa37dec7 enc: remove default build 2025-07-13 19:39:49 +07:00
Pojok Code
5ae8f516b8 enc: add default config 2025-07-13 13:31:30 +07:00
Pojok Code
8bc18a0f0c enc: add update config codeium 2025-07-12 19:39:35 +07:00
Pojok Code
38bf58ad63 enc: add neocodeium config for replace codeium.vim 2025-07-12 17:23:58 +07:00
Pojok Code
64e62e59ba update plugins version 2025-07-12 16:46:48 +07:00
Pojok Code
bb6238e749 enc: update default config 2025-07-08 07:35:24 +07:00
pojok code
37aa6dd7a7 enc: add gemini chat 2025-07-06 20:50:50 +07:00
pojok code
5206ccb56e enc: add config cheatsheet keymaps 2025-07-05 17:40:57 +07:00
pojok code
a4e2d9ec21 enc: add file type definition 2025-07-02 21:27:12 +07:00
pojok code
2ab92b6e94 enc: add keymaps info 2025-07-02 20:46:50 +07:00
pojok code
6d3f3dedad enc: add keymap table documentastions 2025-07-02 07:09:44 +07:00
pojok code
6087de87b0 enc: change visual multi lib 2025-06-29 08:32:10 +07:00
pojok code
282733e5ea enc: add key maps SHIFT+ALT-UP/DOWN for duplicate code 2025-06-28 23:53:00 +07:00
pojok code
fa09a7248e enc: update key mapping for comment 2025-06-28 23:42:52 +07:00
pojok code
1167f053e4 enc: add vitest config 2025-06-27 15:52:23 +07:00
pojok code
bf0a8b2f9b enc: add user command for create new project javascript 2025-06-26 21:58:09 +07:00
pojok code
82392943e2 enc: add create go project whijart 2025-06-26 19:06:22 +07:00
pojok code
68cf1f8bc4 enc: add user command OpenBrowser 2025-06-22 18:48:16 +07:00
pojok code
339f818e4a add: user command for runner cmd 2025-06-22 18:29:49 +07:00
pojok code
7450625ba8 enc: update modal npm runner 2025-06-22 08:43:35 +07:00
pojok code
23a8cf07bf enc: add npm runner with popup modal 2025-06-22 00:37:23 +07:00
pojok code
c1e9e57f17 enc: add npm dev runner for vite 2025-06-21 19:19:34 +07:00
pojok code
dc19ff45d8 enc: update default config 2025-06-21 13:33:57 +07:00
pojok code
5df3f7b2ab enc: add new command 2025-06-16 05:54:53 +07:00
pojok code
82d6ba2889 enc: add telescope diff file 2025-06-14 21:37:42 +07:00
pojok code
bf60de3aa1 fix:disable dressing input 2025-06-14 21:13:57 +07:00
pojok code
d31ffccdca enc: overide command TSInstallInfo 2025-06-14 19:46:00 +07:00
pojok code
d41d9b4cf5 fix: nvim menu create new file 2025-06-14 16:17:17 +07:00
pojok code
f3761c699a enc: update config mason backdrop 2025-06-11 21:13:56 +07:00
pojok code
04f3bfc8a3 enc: update config transparant 2025-06-10 22:57:15 +07:00
pojok code
56982c3434 enc: add uninstall prosedure 2025-06-10 21:41:41 +07:00
pojok code
65b1300677 enc: update transparant config for tabbufferline bg color 2025-06-10 21:09:13 +07:00
pojok code
5b2d06cf97 enc: add transparant config for tab 2025-06-10 07:44:40 +07:00
pojok code
af0923e403 enc: update patch plugins 2025-06-08 20:08:34 +07:00
Asep Komarudin
b727898cf3
update branch 2025-06-08 20:03:52 +07:00
pojok code
69d6dd962d enc: change golang linter to golangci-lint 2025-06-04 09:07:15 +07:00
pojok code
8e0228505a enc: update plugins regular 2025-06-04 06:14:30 +07:00
pojok code
c2fbd57469 enc: update config autocmd 2025-06-04 06:14:13 +07:00
pojok code
5dc5c723b2 fix: update config mason-lspconfig 2025-06-03 21:08:25 +07:00
Pojok Code
2bae787a7d enc: update patch 2025-01-19 13:12:37 +07:00
Pojok Code
d084330d2f enc: add update config kotlin 2024-11-27 09:19:02 +07:00
Pojok Code
3fb9efd7c9 enc: update config java jdtls 2024-11-19 13:03:26 +07:00
Pojok Code
5e9e520a23 enc: update config 2024-11-19 09:03:01 +07:00
Pojok Code
fde1324bf2 enc: update config jdtls 2024-11-19 06:46:04 +07:00
Pojok Code
9166b0e686 Merge branch 'main' into v2.5 2024-11-18 20:18:43 +07:00
Pojok Code
b3f841d25c qa: testing create java project 2024-11-18 20:18:15 +07:00
Pojok Code
b4e2e4d000 Merge branch 'dev' into v2.5 2024-11-17 10:51:49 +07:00
Pojok Code
11a88eb681 enc: add create file java 2024-11-17 10:12:07 +07:00
Pojok Code
c66913e4c2 enc: add gradle create new project 2024-11-16 21:51:22 +07:00
Pojok Code
16264d0b0d enc: add create project java 2024-11-16 20:14:22 +07:00
Pojok Code
3c9cf18933 enc: add run project gradle and maven 2024-11-14 21:19:48 +07:00
Pojok Code
4af6a3dec6 enc: update config jdtls 2024-11-14 19:52:24 +07:00
Pojok Code
26cb34e301 enc: update patch plugins 2024-11-14 15:02:28 +07:00
Pojok Code
353e5a66c7 enc: support neotest for gradle only 2024-11-14 07:50:11 +07:00
Pojok Code
e0a4367eb0 enc: simplify neotest adaptor for java 2024-11-14 06:48:20 +07:00
Pojok Code
d186be6aec enc: add icons to outline 2024-11-14 06:43:36 +07:00
Pojok Code
835b1706b2 enc: update config spesifik language java 2024-11-14 06:20:10 +07:00
Pojok Code
0c56a139ec enc: add jdtls auto config 2024-11-13 05:33:40 +07:00
Pojok Code
273f3ebcb7 enc: add alternative config jdtls 2024-11-12 17:45:45 +07:00
Pojok Code
422efe87ce enc: config jdtls independent 2024-11-12 13:03:22 +07:00
Pojok Code
e9e0ca3e88 add: auto config for jdtls 2024-11-12 09:56:50 +07:00
Pojok Code
b3f5ec5619 enc: set default auto_onatach navic 2024-11-12 07:37:07 +07:00
Pojok Code
db41fc7e00 enc: update config jdtls 2024-11-12 07:30:58 +07:00
Pojok Code
5ab63cdf43 enc: add java key mapping 2024-11-11 23:03:22 +07:00
Pojok Code
292e79137f enc: add dynamic project gradle and maven 2024-11-11 22:47:41 +07:00
Pojok Code
17aee6c301 enc: add config java model 2 2024-11-11 06:21:02 +07:00
Pojok Code
5146726772 enc: add java config project 2024-11-10 00:15:26 +07:00
Pojok Code
35348c069a enc: add gitub theme 2024-11-09 12:20:45 +07:00
Pojok Code
826cbfe9f8 enc: add gruvbox color scheme 2024-11-09 07:14:26 +07:00
Pojok Code
177cf190df enc: add keymapping gradle run if file type java 2024-11-08 21:37:42 +07:00
Pojok Code
b3d4f8b8a1 enc: move default theme to Eva-Dark 2024-11-08 21:10:34 +07:00
Pojok Code
5a64a2e380 enc: disable numbering if lazyload plugins first time 2024-11-08 13:08:06 +07:00
Pojok Code
fe846f291e fix: LSP mapping key 2024-11-08 09:08:04 +07:00
Pojok Code
c21ebc23ef Merge branch 'dev' into v2.5 2024-11-07 15:52:47 +07:00
Pojok Code
c8d51254d4 enc: disable php by default 2024-11-07 15:52:28 +07:00
Pojok Code
b4356bd49a Merge branch 'dev' into v2.5 2024-11-07 08:47:38 +07:00
Pojok Code
8a5c2dd398 fix: evatheme load not proverly 2024-11-07 08:41:48 +07:00
Pojok Code
b5f544bc27 enc: add catppucin theme 2024-11-07 08:35:30 +07:00
Pojok Code
541a0dac95 enc: add tokyonight theme 2024-11-07 08:17:09 +07:00
Pojok Code
ea602aba6e enc: add sublime text theme juliana 2024-11-07 07:29:22 +07:00
Pojok Code
5200fa75aa enc: add dark and light varian theme 2024-11-07 06:44:58 +07:00
Pojok Code
3f5a3a6439 enc: move evatheme overide hilight to std template list 2024-11-07 06:19:54 +07:00
Pojok Code
8b37a27d59 Merge branch 'dev' into v2.5 2024-11-06 15:41:35 +07:00
Pojok Code
11875c382d fix: laravel project for error treesitter 2024-11-06 15:19:48 +07:00
Pojok Code
80f8ade2a5 qa: testing php laravel 2024-11-06 13:48:58 +07:00
Pojok Code
299c94137d fix: conflik key mapping with increment rename 2024-11-06 12:26:52 +07:00
Pojok Code
16c9fa5a36 enc: reformat indentat code 2024-11-06 12:22:10 +07:00
Pojok Code
0ef35939de enc:change keymapping codeium cycle 2024-11-05 22:07:16 +07:00
Pojok Code
e6e7acc2a0 enc: trim white space nvim-cmp 2024-11-05 22:04:01 +07:00
Pojok Code
d5da617c07 fix: move php-cs-fixcer to pretty-php 2024-11-05 16:56:28 +07:00
Pojok Code
1a59409085 Merge branch 'main' into v2.5 2024-11-05 16:15:24 +07:00
Pojok Code
ef38e66bf9 fix: disable laravel.nvim if os windows 2024-11-05 16:15:00 +07:00
Pojok Code
a3bda6f3a5 Merge branch 'dev' 2024-11-05 15:44:12 +07:00
Pojok Code
c52fc5f1d2 Merge branch 'dev' into v2.5 2024-11-05 15:43:48 +07:00
Pojok Code
fc0a994282 fix: rollback laravel.nvim to v2.2.1 2024-11-05 15:35:20 +07:00
Pojok Code
8467b64cd9 enc: move default config from string to table 2024-11-05 15:05:03 +07:00
Pojok Code
ea15a8e8b8 fix: error compila eva theme 2024-11-05 14:28:25 +07:00
Pojok Code
ba77691fb3 fix: evatheme indent scupe color 2024-11-05 08:05:42 +07:00
Pojok Code
50184acdb4 Merge branch 'dev' 2024-11-05 07:42:59 +07:00
Pojok Code
335c0d0cb6 Merge branch 'dev' into v2.5 2024-11-05 07:41:36 +07:00
Pojok Code
edd352519e enc: update alpha mapping for lazy 2024-11-05 07:38:27 +07:00
Pojok Code
9a5c3d6a5b enc: add basic key mapping 2024-11-05 07:33:24 +07:00
Pojok Code
5f97594d62 enc: add snippet path config 2024-11-05 06:09:08 +07:00
Pojok Code
9aebda6491 fix: update lazy starter config 2024-11-04 21:40:14 +07:00
Pojok Code
8767818e34 Merge branch 'v2.5' 2024-11-04 21:33:45 +07:00
Pojok Code
609234c086 enc: upgrade v2 to v2.5 2024-11-04 21:29:25 +07:00
Pojok Code
68ea712b98 enc: update patch plugins 2024-11-04 20:14:48 +07:00
Pojok Code
f5e3f130e4 enc: update notify background 2024-11-04 20:12:57 +07:00
Pojok Code
70e40989c9 enc: update transparent config 2024-11-04 20:12:32 +07:00
Pojok Code
b75362b066 enc: update config zen mode 2024-11-02 22:33:37 +07:00
Pojok Code
4bd49ca963 enc: add zen mode 2024-11-02 22:13:43 +07:00
Pojok Code
dfe7507f5a enc: nvimtree window border color 2024-11-02 14:59:51 +07:00
Pojok Code
54ccd837a9 enc: add nvim menu and colorpicker option 2024-11-02 14:10:32 +07:00
Pojok Code
c8bc3339ea enc: update cmp style 2024-11-01 21:30:07 +07:00
Pojok Code
be3648f80d fix: mason-lspconfig swith with auto-lsp 2024-10-29 22:21:55 +07:00
Pojok Code
ce4b507ca3 fix: rename ts_server to ts_ls 2024-10-29 16:58:55 +07:00
Pojok Code
5559c097d9 enc: update config eva-theme add compile 2024-10-27 14:07:17 +07:00
Pojok Code
f9e08dd537 enc: update config live server 2024-10-26 17:22:29 +07:00
Pojok Code
9b20297edc enc: update config live server 2024-10-26 17:22:09 +07:00
Pojok Code
f7dc5afb5b enc: update patch plugins 2024-10-26 12:36:58 +07:00
Pojok Code
ba028451b6 enc: update dashboard config 2024-10-23 18:07:49 +07:00
Pojok Code
b8d786072a enc: update dashboard config 2024-10-23 16:12:55 +07:00
Pojok Code
05d51faadf enc: update config dashboard 2024-10-23 16:07:07 +07:00
Pojok Code
c09e320633 enc: move lsp config to auto-lsp.nvim 2024-10-20 17:21:07 +07:00
Pojok Code
5f766a5717 enc: update patch plugins 2024-10-19 12:24:36 +07:00
Pojok Code
e2afd37cae fix: nvim tree git ignore hide file 2024-10-12 16:42:46 +07:00
Pojok Code
cde110e7bd Merge branch 'v2' 2024-10-11 21:18:14 +07:00
Pojok Code
51f6b3bcd4 enc: update config eva-theme 2024-10-11 21:17:05 +07:00
Pojok Code
27f602e210 enc: 2024-10-11 21:17:05 +07:00
Pojok Code
ad9f646417 Merge branch 'v2' into dev 2024-10-11 21:09:02 +07:00
Pojok Code
0ee6631931 enc: fix nvim-tree error exploler 2024-10-11 21:02:53 +07:00
Pojok Code
30ba4f5233 enc: fix nvim-tree exploler error 2024-10-11 21:00:37 +07:00
Pojok Code
2ce30970f6 enc: fix nvim-tree open file exploler 2024-10-11 21:00:07 +07:00
Pojok Code
cfbb38f75e enc: backup nvim-tree config 2024-10-11 20:36:00 +07:00
Pojok Code
ceb786c9cc enc: create backup nvim-tree config 2024-10-11 20:35:34 +07:00
Pojok Code
3c34a7ba22 fix: error nvim-tree indent file 2024-10-11 17:28:02 +07:00
Pojok Code
d0194ea92e enc: patch plugins 2024-10-06 12:49:52 +07:00
Pojok Code
ec403e8b54 enc: update patch plugins 2024-10-02 08:00:43 +07:00
Pojok Code
09c5fdd259 enc: update patch plugins 2024-09-22 12:05:34 +07:00
Pojok Code
aeae04bacf enc: update patch plugins 2024-09-13 05:50:10 +07:00
Pojok Code
3ddbd80e6a enc: update patch plugins 2024-09-10 07:44:52 +07:00
Pojok Code
870e0fe28a enc: update patch plugins 2024-09-04 07:53:45 +07:00
Pojok Code
f488cd1495 enc: update patch plugins 2024-08-30 21:28:41 +07:00
Pojok Code
ee0092886d enc: update patch plugins 2024-08-30 18:54:01 +07:00
Pojok Code
4d03c39f7a enc: update patch plgins 2024-08-30 05:25:57 +07:00
Pojok Code
70185c6de3 enc: update patch plugins 2024-08-29 06:46:35 +07:00
Pojok Code
2b1a97a9f2 enc: update patch plugins 2024-08-28 06:52:16 +07:00
Pojok Code
891086f606 enc: update patch plugins 2024-08-27 12:59:14 +07:00
Pojok Code
82b68e6d01 enc: update patch plugins 2024-08-26 07:43:46 +07:00
Pojok Code
4894f180e6 enc: update patch plugins 2024-08-25 14:57:20 +07:00
Pojok Code
245f1b7abb enc: update patch plugins 2024-08-25 12:02:39 +07:00
Pojok Code
be42c75ded enc: update patch plugins 2024-08-24 13:22:23 +07:00
Pojok Code
60fa8e90c6 enc: update patch plugins 2024-08-23 15:15:26 +07:00
Pojok Code
1629caa700 enc: update patch plugins 2024-08-22 17:11:55 +07:00
Pojok Code
3ac997cc10 enc: update config 2024-08-19 21:39:51 +07:00
Pojok Code
72b8b4b531 enc: update patch plugins 2024-08-15 07:46:49 +07:00
Pojok Code
12ec8d33ef enc: update config eva-theme 2024-08-03 21:09:59 +07:00
Pojok Code
cfea979e6b enc: 2024-08-03 21:09:32 +07:00
Pojok Code
e76eea2ebb enc: update eva-theme config 2024-08-03 18:05:19 +07:00
Pojok Code
87a44d46db enc: update config Eva-theme 2024-08-03 18:04:40 +07:00
Pojok Code
41bc2bce8f enc: update patch plugins 2024-08-03 17:28:09 +07:00
Pojok Code
f6ec28fbba enc: update patch plugins 2024-08-02 08:14:03 +07:00
Pojok Code
9762d71c6e enc: update config bufferline 2024-07-28 14:21:42 +07:00
Pojok Code
ab014bb8b5 enc: update patch plugins 2024-07-26 06:54:47 +07:00
Pojok Code
0f9e5836be enc: update patch plugins 2024-07-24 05:30:51 +07:00
Pojok Code
5cf2456f6c enc: update patch plugins 2024-07-21 18:22:34 +07:00
Pojok Code
9b806d2ed1 enc: update codeium event load 2024-07-21 05:48:00 +07:00
Pojok Code
224d29c616 enc: add config lualine eva-dark theme 2024-07-20 18:25:02 +07:00
Pojok Code
52b270121f enc: update patch plugins 2024-07-20 07:08:25 +07:00
Pojok Code
6143c6a95d enc: change bufferline trank marker 2024-07-18 22:26:11 +07:00
Pojok Code
bde07f949a fix: error which-key.nvim update config 2024-07-18 16:53:21 +07:00
Pojok Code
38a9984694 enc: update config which-key 2024-07-16 08:11:40 +07:00
Pojok Code
a2240b582c enc: set border rounded 2024-07-13 16:56:03 +07:00
Pojok Code
f69bcdf155 enc: update patch plugins 2024-07-13 16:49:59 +07:00
Pojok Code
18f8a746e4 enc: update default config which-key 2024-07-13 13:28:39 +07:00
Pojok Code
c0eb97fa96 enc: move keymap from which-key to bufferline 2024-07-13 13:23:31 +07:00
Pojok Code
7962b741bd enc: update config which-key 2024-07-13 13:07:24 +07:00
Pojok Code
1aa86bfa2d change: vim.g.pcode_icon to pcode.icons 2024-07-09 17:09:04 +07:00
Pojok Code
624d3aceb6 enc: make modular config 2024-07-09 16:48:34 +07:00
Pojok Code
d46370f0b3 enc: update plugins config 2024-07-07 08:41:02 +07:00
Pojok Code
b6711611ec enc: move lsp line repository to abzcoding/lsp_lines.nvim 2024-07-07 06:02:56 +07:00
Pojok Code
aa8f68d8aa add: lsp bufread, bufNewFile, BufreadFre 2024-07-06 16:40:01 +07:00
Pojok Code
32b5eba8bb enc: update patch library 2024-07-06 14:17:33 +07:00
asep.komarudin
ff62c20795 enc: migrate to auto-lint and auto-conform 2024-07-05 07:59:12 +07:00
asep.komarudin
eace6b6674 add: default tab 4 2024-07-05 06:59:04 +07:00
asep.komarudin
03a3d5f32b enc: update config jdtls 2024-07-05 06:44:07 +07:00
asep.komarudin
e7c7785cc5 enc: add auto lint nvim-lint 2024-07-04 20:52:02 +07:00
asep.komarudin
19abed8ac0 enc: update config auto conform 2024-07-03 20:46:24 +07:00
asep.komarudin
dd872b6ea5 add: auto-conform config plugins 2024-07-02 21:55:22 +07:00
asep.komarudin
a636b2988d enc: update jetbrains theme relative number color 2024-07-02 19:48:49 +07:00
asep.komarudin
a72df67e8f add: darcula custom jsonc hilight @variable 2024-07-02 16:31:31 +07:00
asep.komarudin
4f3feb5c38 fix: close currrent buffer 2024-07-02 08:21:51 +07:00
asep.komarudin
49478d3a89 fix: npx prisma stude execute command 2024-07-01 18:44:45 +07:00
asep.komarudin
fecc32cc9e add: conform ensure instaled 2024-07-01 18:00:04 +07:00
501 changed files with 9188 additions and 91893 deletions

View file

@ -67,40 +67,46 @@
## Basic Requirement
2. Install Neovim 0.95+ https://github.com/neovim/neovim/releases/tag/stable
3. C++ https://www.msys2.org/
4. GIT https://git-scm.com/download/win
5. NodeJs https://nodejs.org/en/
6. Ripgrep https://github.com/BurntSushi/ripgrep
7. Lazygit https://github.com/jesseduffield/lazygit
8. Nerd Font https://www.nerdfonts.com/ or https://github.com/ryanoasis/nerd-fonts
9. Windows Terminal (Windows) https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-id&gl=id
10. Powershell (windows) https://apps.microsoft.com/store/detail/powershell/9MZ1SNWT0N5D?hl=en-id&gl=id
1. C++ https://www.msys2.org/
1. GIT https://git-scm.com/download/win
1. NodeJs https://nodejs.org/en/
1. Ripgrep https://github.com/BurntSushi/ripgrep
1. Lazygit https://github.com/jesseduffield/lazygit
1. Nerd Font https://www.nerdfonts.com/ or https://github.com/ryanoasis/nerd-fonts
1. Windows Terminal (Windows) https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-id&gl=id
1. Powershell (windows) https://apps.microsoft.com/store/detail/powershell/9MZ1SNWT0N5D?hl=en-id&gl=id
# Windows
```
git clone https://github.com/pojokcodeid/nvim-lazy-basic.git "$env:LOCALAPPDATA\nvim"
git clone https://github.com/pojokcodeid/neovim-starter.git "$env:LOCALAPPDATA\nvim"
nvim
```
# Linux
```bash
git clone https://github.com/pojokcodeid/nvim-lazy-basic.git ~/.config/nvim
git clone https://github.com/pojokcodeid/neovim-starter.git ~/.config/nvim
```
# Uninstall
```bash
# Linux / Macos (unix)
# Linux / MacOS (unix)
rm -rf ~/.config/nvim
rm -rf ~/.local/state/nvim
rm -rf ~/.local/share/nvim
# Flatpak (linux)
rm -rf ~/.var/app/io.neovim.nvim/config/nvim
rm -rf ~/.var/app/io.neovim.nvim/data/nvim
rm -rf ~/.var/app/io.neovim.nvim/.local/state/nvim
# Windows CMD
rd -r ~\AppData\Local\nvim
rd -r ~\AppData\Local\nvim-data
# Window PowerShell
# Windows PowerShell
rm -Force ~\AppData\Local\nvim
rm -Force ~\AppData\Local\nvim-data
```

View file

@ -1 +0,0 @@
vim.bo.commentstring = '{{-- %s --}}'

View file

@ -1 +0,0 @@
vim.bo.commentstring = '// %s'

View file

@ -1 +0,0 @@
vim.bo.commentstring = '<!-- %s -->'

View file

@ -1,4 +0,0 @@
(directive) @tag
(directive_start) @tag
(directive_end) @tag
(comment) @comment @spell

View file

@ -1,16 +0,0 @@
((text) @injection.content
(#not-has-ancestor? @injection.content "envoy")
(#set! injection.combined)
(#set! injection.language php))
((text) @injection.content
(#has-ancestor? @injection.content "envoy")
(#set! injection.combined)
(#set! injection.language bash))
((php_only) @injection.content
(#set! injection.combined)
(#set! injection.language php_only))
((parameter) @injection.content
(#set! injection.language php_only))

View file

@ -1,36 +0,0 @@
;; extends
; AlpineJS attributes
(attribute
(attribute_name) @_attr
(#lua-match? @_attr "^x%-%l")
(#not-any-of? @_attr "x-teleport" "x-ref" "x-transition")
(quoted_attribute_value
(attribute_value) @injection.content)
(#set! injection.language "javascript"))
; Blade escaped JS attributes
; <x-foo ::bar="baz" />
(element
(_
(tag_name) @_tag
(#lua-match? @_tag "^x%-%l")
(attribute
(attribute_name) @_attr
(#lua-match? @_attr "^::%l")
(quoted_attribute_value
(attribute_value) @injection.content)
(#set! injection.language "javascript"))))
; Blade PHP attributes
; <x-foo :bar="$baz" />
(element
(_
(tag_name) @_tag
(#lua-match? @_tag "^x%-%l")
(attribute
(attribute_name) @_attr
(#lua-match? @_attr "^:%l")
(quoted_attribute_value
(attribute_value) @injection.content)
(#set! injection.language "php_only"))))

View file

@ -1,10 +0,0 @@
;; extends
[
; prevent double indent for `return new class ...`
(return_statement
(object_creation_expression))
; prevent double indent for `return function() { ... }`
(return_statement
(anonymous_function_creation_expression))
] @indent.dedent

View file

@ -1,9 +0,0 @@
;; extends
; ((text) @injection.content
; (#set! injection.language "html")
; (#set! injection.combined))
; ((php) @injection.content
; (#set! injection.language "php_only")
; (#set! injection.combined))

View file

@ -1,51 +0,0 @@
-- local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
-- if not lspconfig_status_ok then
-- return
-- end
--
-- local status_ok, configs = pcall(require, "nvim-treesitter.configs")
-- if not status_ok then
-- return
-- end
--
-- local mason_ok, mason_lsp = pcall(require, "mason-lspconfig")
-- if not mason_ok then
-- return
-- end
--
-- mason_lsp.setup({
-- ensure_installed = { "clangd" },
-- automatic_installation = true,
-- })
--
-- lspconfig.clangd.setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- capabilities = require("user.lsp.handlers").capabilities,
-- root_dir = require("lspconfig.util").root_pattern(
-- "build",
-- "compile_commands.json",
-- ".git",
-- "mvnw",
-- "gradlew",
-- "pom.xml",
-- "build.gradle"
-- ) or vim.loop.cwd() or vim.fn.getcwd(),
-- })
--
-- configs.setup({
-- ensure_installed = { "cpp" }, -- pastikan parser TypeScript terinstal
-- highlight = {
-- enable = true, -- aktifkan highlight berbasis treesitter
-- additional_vim_regex_highlighting = false,
-- },
-- rainbow = {
-- enable = false,
-- },
-- incremental_selection = { enable = true },
-- indent = { enable = true, disable = { "python", "css" } },
-- autopairs = {
-- enable = true,
-- },
-- })
--
-- require("nvim-ts-autotag").setup()

View file

@ -1,7 +0,0 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
local opt = vim.opt
opt.shiftwidth = 2 -- Size of an indent
opt.tabstop = 2 -- Size of an indent

View file

@ -1,180 +0,0 @@
-- more space in the neovim command line for displaying messages
-- use this function notation to build some variables
-- vim.opt_local.shiftwidth = 4
-- vim.opt_local.tabstop = 4
-- vim.opt_local.softtabstop = 4
-- vim.opt_local.ts = 4
-- vim.opt_local.expandtab = true
--
-- local status, jdtls = pcall(require, "jdtls")
-- if not status then
-- return
-- end
--
-- local function capabilities()
-- local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
-- if status_ok then
-- return cmp_nvim_lsp.default_capabilities()
-- end
--
-- local CAPABILITIES = vim.lsp.protocol.make_client_capabilities()
-- CAPABILITIES.textDocument.completion.completionItem.snippetSupport = true
-- CAPABILITIES.textDocument.completion.completionItem.resolveSupport = {
-- properties = {
-- "documentation",
-- "detail",
-- "additionalTextEdits",
-- },
-- }
--
-- return CAPABILITIES
-- end
--
-- local function directory_exists(path)
-- local f = io.popen("cd " .. path)
-- local ff = f:read("*all")
--
-- if ff:find("ItemNotFoundException") then
-- return false
-- else
-- return true
-- end
-- end
--
-- local root_markers = { ".git", "mvnw", "gradlew", "pom.xml", "build.gradle" }
-- local root_dir = require("jdtls.setup").find_root(root_markers)
--
-- -- calculate workspace dir
-- local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
-- local workspace_dir = vim.fn.stdpath("data") .. "/site/java/workspace-root/" .. project_name
-- if directory_exists(workspace_dir) then
-- else
-- os.execute("mkdir " .. workspace_dir)
-- end
-- -- get the mason install path
-- local install_path = require("mason-registry").get_package("jdtls"):get_install_path()
--
-- -- get the current OS
-- local os
-- if vim.fn.has("macunix") then
-- os = "mac"
-- elseif vim.fn.has("win32") then
-- os = "win"
-- else
-- os = "linux"
-- end
--
-- local bundles = {}
-- local mason_path = vim.fn.glob(vim.fn.stdpath("data") .. "/mason/")
-- vim.list_extend(bundles, vim.split(vim.fn.glob(mason_path .. "packages/java-test/extension/server/*.jar"), "\n"))
-- vim.list_extend(
-- bundles,
-- vim.split(
-- vim.fn.glob(
-- vim.fn.stdpath("data")
-- .. "/lazy/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-*.jar"
-- ),
-- "\n"
-- )
-- )
--
-- local config = {
-- cmd = {
-- "java",
-- "-Declipse.application=org.eclipse.jdt.ls.core.id1",
-- "-Dosgi.bundles.defaultStartLevel=4",
-- "-Declipse.product=org.eclipse.jdt.ls.core.product",
-- "-Dlog.protocol=true",
-- "-Dlog.level=ALL",
-- "-javaagent:" .. install_path .. "/lombok.jar",
-- "-Xms1g",
-- "--add-modules=ALL-SYSTEM",
-- "--add-opens",
-- "java.base/java.util=ALL-UNNAMED",
-- "--add-opens",
-- "java.base/java.lang=ALL-UNNAMED",
-- "-jar",
-- vim.fn.glob(install_path .. "/plugins/org.eclipse.equinox.launcher_*.jar"),
-- "-configuration",
-- install_path .. "/config_" .. os,
-- "-data",
-- workspace_dir,
-- },
-- capabilities = capabilities(),
-- root_dir = root_dir,
-- settings = {
-- java = {},
-- },
--
-- init_options = {
-- bundles = bundles,
-- -- bundles = {
-- -- vim.fn.glob(
-- -- mason_path .. "packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar",
-- -- "\n"
-- -- ),
-- -- },
-- },
-- }
--
-- config["on_attach"] = function(client, bufnr)
-- local _, _ = pcall(vim.lsp.codelens.refresh)
--
-- -- valdation if DAP not installed
-- local dap_status, _ = pcall(require, "nvim-dap")
-- if not dap_status then
-- return
-- end
--
-- require("jdtls.dap").setup_dap_main_class_configs()
-- jdtls.setup_dap({ hotcodereplace = "auto" })
-- require("user.lsp.handlers").on_attach(client, bufnr)
-- end
--
-- vim.api.nvim_create_autocmd({ "BufWritePost" }, {
-- pattern = { "*.java" },
-- callback = function()
-- local _, _ = pcall(vim.lsp.codelens.refresh)
-- end,
-- })
--
-- jdtls.start_or_attach(config)
--
-- vim.cmd(
-- [[command! -buffer -nargs=? -complete=custom,v:lua.require'jdtls'._complete_set_runtime JdtSetRuntime lua require('jdtls').set_runtime(<f-args>)]]
-- )
-- local mason_reg = require("mason-registry")
-- for _, pkg in pairs(mason_reg.get_installed_packages()) do
-- for _, type in pairs(pkg.spec.categories) do
-- if type == "LSP" and pkg.spec.name == "jdtls" then
-- local ok, lspconfig = pcall(require, "lspconfig")
-- if not ok then
-- return
-- end
--
-- lspconfig.jdtls.setup({
-- cmd = {
-- "jdtls",
-- "-configuration",
-- vim.fn.expand("$HOME") .. "/.cache/jdtls/config",
-- "-data",
-- vim.fn.expand("$HOME") .. "/.cache/jdtls/workspace",
-- },
-- filetypes = { "java" },
-- root_dir = require("lspconfig.util").root_pattern(
-- -- Single-module projects
-- {
-- "build.xml", -- Ant
-- "pom.xml", -- Maven
-- "settings.gradle", -- Gradle
-- "settings.gradle.kts", -- Gradle
-- },
-- -- Multi-module projects
-- { "build.gradle", "build.gradle.kts" }
-- ) or vim.fn.getcwd(),
-- singe_file_support = true,
-- })
-- end
-- end
-- end

View file

@ -1,4 +0,0 @@
vim.opt_local.expandtab = true
vim.opt_local.shiftwidth = 2
vim.opt_local.tabstop = 2
vim.opt_local.softtabstop = 2

View file

@ -1,59 +0,0 @@
-- vim.opt_local.expandtab = true
-- vim.opt_local.shiftwidth = 4
-- vim.opt_local.tabstop = 4
-- vim.opt_local.softtabstop = 4
-- local status_ok, configs = pcall(require, "nvim-treesitter.configs")
-- if not status_ok then
-- return
-- end
-- local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
-- if not lspconfig_status_ok then
-- return
-- end
-- local mason_ok, mason_lsp = pcall(require, "mason-lspconfig")
-- if not mason_ok then
-- return
-- end
-- mason_lsp.setup({
-- ensure_installed = { "kotlin_language_server" },
-- automatic_installation = true,
-- })
-- lspconfig.kotlin_language_server.setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- capabilities = require("user.lsp.handlers").capabilities,
-- cmd = { "kotlin-language-server" },
-- filetypes = { "kotlin" },
-- root_dir = require("lspconfig.util").root_pattern(
-- "build.gradle.kts",
-- "build.gradle",
-- "settings.gradle",
-- "gradlew",
-- "pom.xml",
-- "build.gradle.kts",
-- "build.kts",
-- ".git"
-- ),
-- })
-- configs.setup({
-- ensure_installed = { "kotlin" }, -- pastikan parser TypeScript terinstal
-- highlight = {
-- enable = true, -- aktifkan highlight berbasis treesitter
-- additional_vim_regex_highlighting = false,
-- },
-- rainbow = {
-- enable = false,
-- },
-- incremental_selection = { enable = true },
-- indent = { enable = true, disable = { "python", "css" } },
-- autopairs = {
-- enable = true,
-- },
-- })
--
-- require("nvim-ts-autotag").setup()

View file

@ -1,4 +0,0 @@
vim.opt_local.expandtab = true
vim.opt_local.shiftwidth = 2
vim.opt_local.tabstop = 2
vim.opt_local.softtabstop = 2

View file

@ -1,5 +0,0 @@
vim.opt_local.shiftwidth = 4
vim.opt_local.tabstop = 4
vim.opt_local.softtabstop = 4
vim.opt_local.ts = 4
vim.opt_local.expandtab = true

View file

@ -1,4 +0,0 @@
vim.opt_local.expandtab = true
vim.opt_local.shiftwidth = 4
vim.opt_local.tabstop = 4
vim.opt_local.softtabstop = 4

View file

@ -1,109 +0,0 @@
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
return
end
configs.setup({
ensure_installed = { "typescript", "tsx" }, -- pastikan parser TypeScript terinstal
highlight = {
enable = true, -- aktifkan highlight berbasis treesitter
additional_vim_regex_highlighting = false,
},
rainbow = {
enable = false,
},
incremental_selection = { enable = true },
indent = { enable = true, disable = { "python", "css" } },
autopairs = {
enable = true,
},
})
require("nvim-ts-autotag").setup()
-- local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
-- if not lspconfig_status_ok then
-- return
-- end
-- local function idxOf(array, value)
-- for i, v in ipairs(array) do
-- if v == value then
-- return i
-- end
-- end
-- return nil
-- end
-- local unregis_lsp = {}
-- local data_ok, unregis = pcall(require, "core.config")
-- if data_ok then
-- if unregis.unregister_lsp ~= nil then
-- unregis_lsp = unregis.unregister_lsp
-- end
-- end
-- local idxts = idxOf(unregis_lsp, "tsserver")
-- if idxts ~= nil then
-- lspconfig.tsserver.setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- capabilities = require("user.lsp.handlers").capabilities,
-- -- add cmd
-- cmd = { "typescript-language-server", "--stdio" },
-- -- add file type support
-- filetypes = {
-- "javascript",
-- "javascriptreact",
-- "javascript.jsx",
-- "typescript",
-- "typescriptreact",
-- "typescript.tsx",
-- },
-- -- add dynamic root dir support
-- root_dir = require("lspconfig.util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"),
-- init_options = {
-- hostInfo = "neovim",
-- },
-- })
-- end
-- local idxemmet = idxOf(unregis_lsp, "emmet_ls")
-- if idxemmet ~= nil then
-- lspconfig.emmet_ls.setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- capabilities = require("user.lsp.handlers").capabilities,
-- -- add cmd
-- cmd = { "emmet-ls", "-c", "--stdio" },
-- -- add file type support
-- filetypes = {
-- "javascript",
-- "javascriptreact",
-- "javascript.jsx",
-- "typescript",
-- "typescriptreact",
-- "typescript.tsx",
-- },
-- -- add dynamic root dir support
-- root_dir = require("lspconfig.util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"),
-- })
-- end
-- local idxeslint = idxOf(unregis_lsp, "eslint")
-- if idxeslint ~= nil then
-- lspconfig.eslint.setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- capabilities = require("user.lsp.handlers").capabilities,
-- -- add cmd
-- cmd = { "vscode-eslint-language-server", "--stdio" }, -- add file type support
-- filetypes = {
-- "javascript",
-- "javascriptreact",
-- "javascript.jsx",
-- "typescript",
-- "typescriptreact",
-- "typescript.tsx",
-- },
-- -- add dynamic root dir support
-- root_dir = require("lspconfig.util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"),
-- })
-- end

View file

@ -1,4 +1,3 @@
-- PERF fully optimized
if vim.g.vscode then
-- config vscode
Map = vim.keymap.set
@ -11,5 +10,5 @@ if vim.g.vscode then
require("_vscode.mappings")
else
-- config neovim
require("core")
require("pcode.core")
end

View file

@ -1,65 +1,58 @@
{
"Comment.nvim": { "branch": "master", "commit": "e51f2b142d88bb666dcaa77d93a07f4b419aca70" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" },
"bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" },
"bufferline.nvim": { "branch": "main", "commit": "81820cac7c85e51e4cf179f8a66d13dbf7b032d9" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
"alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" },
"auto-bufferline.nvim": { "branch": "main", "commit": "6a69520dcb0dc615df3cf972f69027aae3f75c3e" },
"auto-conform.nvim": { "branch": "main", "commit": "5f0897235e84bf2f8ff9d634e81678d5bfa63ab8" },
"auto-lint.nvim": { "branch": "main", "commit": "aff13cb8eaa055e66e940d43b7d83166397e5413" },
"auto-lsp.nvim": { "branch": "main", "commit": "f32c94fff2862c313f4e150eb39dd0dc9bf18755" },
"auto-lualine.nvim": { "branch": "main", "commit": "201da916411a56d0b27905528a7cb49a320ee054" },
"breadcrumbs.nvim": { "branch": "master", "commit": "9f764278784ce2f10dbe2f555ba14be2451d36a0" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" },
"codeium.nvim": { "branch": "main", "commit": "d3b88eb3aa1de6da33d325c196b8a41da2bcc825" },
"conform.nvim": { "branch": "master", "commit": "60e6fbddbdf37d7790de07dc7420beefaf650e5e" },
"dracula.nvim": { "branch": "main", "commit": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c" },
"dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" },
"friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" },
"gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" },
"indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" },
"lazy.nvim": { "branch": "main", "commit": "c882227f1fdc4580d14212df8f814a0772951e3d" },
"live-server.nvim": { "branch": "main", "commit": "f34ae262bf046981d9e5f7cd4f41a353a9647a22" },
"lsp-progress.nvim": { "branch": "main", "commit": "55a04895ea20c365b670051a3128265d43bdfa3d" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "4ba55f9755ebe8297d92c419b90a946123292ae6" },
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
"mini.indentscope": { "branch": "main", "commit": "56d42be090e8fcc68eda69cfe55af8c5e562300e" },
"neoscroll.nvim": { "branch": "master", "commit": "a731f66f1d39ec6175fd201c5bf849e54abda99c" },
"noice.nvim": { "branch": "main", "commit": "03c6a75661e68012e30b0ed81f050358b1e2233c" },
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
"nvim-dap": { "branch": "master", "commit": "5ba8ceace596360321cf33fa4b56d9d46e057ce9" },
"nvim-dap-ui": { "branch": "master", "commit": "f7d75cca202b52a60c520ec7b1ec3414d6e77b0f" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "d7c695ea39542f6da94ee4d66176f5d660ab0a77" },
"nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" },
"nvim-lspconfig": { "branch": "master", "commit": "0b8165cf95806bc4bb8f745bb0c92021b2ed4b98" },
"nvim-material-icon": { "branch": "main", "commit": "01d95380c6c643d663f8d3cf8a7b274ece6da389" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" },
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
"nvim-scrollview": { "branch": "main", "commit": "06563ae0c9928a2df42aefe66f2aed2f2943e32e" },
"nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" },
"nvim-treesitter": { "branch": "master", "commit": "7ff0b8d3d21b15eb7231fcbd2acfded8987f5efd" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" },
"nvim-ts-autotag": { "branch": "main", "commit": "ddfccbf0df1b9349c2b9e9b17f4afa8f9b6c1ed1" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" },
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
"playground": { "branch": "master", "commit": "bcfab84f98a33f2ad34dda6c842046dca70aabf6" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" },
"rest.nvim": { "branch": "main", "commit": "91badd46c60df6bd9800c809056af2d80d33da4c" },
"smart-splits.nvim": { "branch": "master", "commit": "66fda3a601a5b4c679656f15eb6ddd613c8d3216" },
"telescope.nvim": { "branch": "master", "commit": "7bd2f9b72f8449780b79bcf351534e2cd36ec43a" },
"tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "9be4af5b1bc1f26a11206ed7ce8bf44312e7941a" },
"toggleterm.nvim": { "branch": "main", "commit": "cd55bf6aab3f88c259fa29ea86bbdcb1a325687d" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-startuptime": { "branch": "master", "commit": "97a88e688482a09c3c4b777d07b509b328a5ec29" },
"vim-visual-multi": { "branch": "master", "commit": "525521677deb8401b62054bbbbc9b17f8486de3d" },
"virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" },
"which-key.nvim": { "branch": "main", "commit": "0539da005b98b02cf730c1d9da82b8e8edb1c2d2" },
"yanky.nvim": { "branch": "main", "commit": "9268018e92d02650a94e39dd5f5903c542f7ea11" }
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"cmp-rg": { "branch": "master", "commit": "70a43543f61b6083ba9c3b7deb9ccee671410ac6" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"code_runner.nvim": { "branch": "main", "commit": "65c8d11f507073b915f10faa88ea05bd4fbf69ce" },
"colorful-menu.nvim": { "branch": "master", "commit": "bc3e82609f2fcf7dad7ca87c20e65e51d5d9d87c" },
"conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" },
"dracula.nvim": { "branch": "main", "commit": "96c9d19ce81b26053055ad6f688277d655b3f7d2" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "8270378ab83540b03d09c0194ba3e208f9d0cb72" },
"hlchunk.nvim": { "branch": "main", "commit": "474ec5d0f220158afa83aaefab32402e710d3032" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lsp_signature.nvim": { "branch": "master", "commit": "62cadce83aaceed677ffe7a2d6a57141af7131ea" },
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "844d247d998c2f9a6a3baad8bb9748edc55ce69f" },
"mason.nvim": { "branch": "main", "commit": "9e25c98d4826998460926f8c5c2284848d80ae89" },
"multiple-cursors.nvim": { "branch": "main", "commit": "1ac15d047a4b265cc2389957bcc56ee561b29e02" },
"neocodeium": { "branch": "main", "commit": "272aed226827d8dadb85b4d9e2c9bb6bd30b4033" },
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lint": { "branch": "master", "commit": "7ef127aaede2a4d5ad8df8321e2eb4e567f29594" },
"nvim-lspconfig": { "branch": "master", "commit": "d0dbf489a8810672fa9a61f4a86e5cf89214b772" },
"nvim-material-icon": { "branch": "main", "commit": "c25a4e56be2f846dfdf8f30b980adc17f219d019" },
"nvim-navic": { "branch": "master", "commit": "f887d794a0f4594882814d7780980a949200a238" },
"nvim-notify": { "branch": "master", "commit": "397c7c1184745fca649e5104de659e6392ef5a4d" },
"nvim-tree.lua": { "branch": "master", "commit": "65bae449224b8a3bc149471b96587b23b13a9946" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"nvim-web-devicons": { "branch": "master", "commit": "3362099de3368aa620a8105b19ed04c2053e38c0" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "97bf4b8ef9298644a29fcd9dd41a0210cf08cac7" },
"showkeys": { "branch": "main", "commit": "cb0a50296f11f1e585acffba8c253b9e8afc1f84" },
"smart-splits.nvim": { "branch": "master", "commit": "f46b79cf9e83b0a13a4e3f83e3bd5b0d2f172bf2" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
"vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" },
"virt-column.nvim": { "branch": "master", "commit": "b87e3e0864211a32724a2ebf3be37e24e9e2fa99" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
"yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" }
}

View file

@ -31,9 +31,11 @@ Map("n", "zy", Toggle_breakpoint)
Map("n", "yr", Copy_relative_path)
Map("n", "yR", Copy_path)
Map({ "n", "i", "v", "x" }, "<C-a>", Select_all)
Map({ "n", "v", "x" }, "y", Copy_clipboard)
Map({ "n", "v", "x" }, "p", Paste_clipboard)
Map({ "n", "v", "x" }, "<C-s>", Save)
Map({ "n", "v", "x", "i" }, "y", Copy_clipboard)
Map({ "n", "v", "x", "i" }, "<C-c>", Copy_clipboard)
Map({ "n", "v", "x", "i" }, "p", Paste_clipboard)
Map({ "n", "v", "x", "i" }, "<C-v>", Paste_clipboard)
Map({ "n", "v", "x", "i" }, "<C-s>", Save)
Map({ "n" }, "q", Close)
Map("v", "gs", Codesnap)

View file

@ -0,0 +1,76 @@
local function gradle_new_project()
local function create_notif(message, level)
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify(message, level)
else
print(message)
end
end
-- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan
local function get_user_input(prompt, default_value)
vim.fn.inputsave()
local result = vim.fn.input(prompt, default_value)
vim.fn.inputrestore()
-- Cek apakah pengguna menekan Esc untuk membatalkan input
if result == "" then
create_notif("Input canceled.", "info")
return nil, true
end
return result, false
end
-- Ambil input Testing
local test, canceled_test = get_user_input("Testing (junit,junit-jupiter,testng,spock): ", "junit-jupiter")
if canceled_test then
return
end
-- Ambil input DSL
local script_dsl, canceled_dsl = get_user_input("Script DSL (kotlin, groovy): ", "groovy")
if canceled_dsl then
return
end
-- Ambil input package name
local package_name, canceled_package = get_user_input("Enter package name: ", "com.example")
if canceled_package then
return
end
-- Format perintah Gradle berdasarkan input pengguna
local command = string.format(
"echo no | gradle init --type java-application --test-framework %s --dsl %s --package %s --no-daemon",
test,
script_dsl,
package_name
)
-- Fungsi untuk menjalankan perintah Gradle dan menampilkan outputnya
local function run_gradle_command(cmd, path, pkg)
local output = vim.fn.system(cmd)
if vim.v.shell_error ~= 0 then
create_notif("Error executing: " .. output, "error")
else
create_notif("Project created successfully!", "info")
create_notif("Please Reopen Dir : " .. path, "info")
vim.cmd(":NvimTreeFindFileToggle<CR>")
local main_class_path = string.format("%s/app/src/main/java/%s/App.java", path, pkg:gsub("%.", "/"))
if vim.fn.filereadable(main_class_path) == 1 then
vim.cmd(":edit " .. main_class_path)
end
local function delayed_quit()
vim.defer_fn(function()
vim.cmd("qa!")
end, 4000) -- Delay is set in milliseconds (3,000ms = 3 seconds)
end
-- Run the delayed quit function
delayed_quit()
end
end
-- Jalankan perintah Gradle dan buka proyek
run_gradle_command(command, vim.fn.getcwd(), package_name)
end
vim.api.nvim_create_user_command("GradleNewProject", gradle_new_project, {})

View file

@ -0,0 +1,123 @@
local function mvn_new_project()
local function create_notif(message, level)
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify(message, level)
else
print(message)
end
end
-- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan
local function get_user_input(prompt, default_value)
vim.fn.inputsave()
local result = vim.fn.input(prompt, default_value)
vim.fn.inputrestore()
-- Cek apakah pengguna menekan Esc untuk membatalkan input
if result == "" then
create_notif("Input canceled.", "info")
return nil, true
end
return result, false
end
-- Ambil input dari pengguna untuk menentukan direktori proyek
local project_dir, canceled = get_user_input("Enter project directory: ", vim.fn.getcwd())
if canceled then
return
end
-- Buat direktori jika belum ada
if vim.fn.isdirectory(project_dir) == 0 then
if vim.fn.mkdir(project_dir, "p") == 0 then
create_notif("Failed to create project directory: " .. project_dir, "error")
return
end
end
-- Pindah ke direktori proyek
-- Hapus satu level dari path
local parent_dir = vim.fn.fnamemodify(project_dir, ":h")
local success, err = pcall(vim.fn.chdir, parent_dir)
if not success then
create_notif("Error changing directory: " .. err, "error")
return
end
create_notif("Changed directory to: " .. project_dir, "info")
-- Fungsi untuk mendapatkan nama direktori terakhir dari path
local function getLastDirName(path)
local uname = vim.loop.os_uname().sysname
local name
if uname == "Windows_NT" then
name = path:match("([^\\]+)$")
else
name = path:match("([^/]+)$")
end
return name
end
-- Ambil input dari pengguna untuk Maven
local group_id, canceled_group = get_user_input("Enter groupId: ", "com.example")
if canceled_group then
return
end
local artifact_id = getLastDirName(project_dir)
local archetype_artifact_id, canceled_archetype =
get_user_input("Enter archetypeArtifactId: ", "maven-archetype-quickstart")
if canceled_archetype then
return
end
local archetype_version, canceled_version = get_user_input("Enter archetypeVersion: ", "1.5")
if canceled_version then
return
end
local interactive_mode, canceled_interactive = get_user_input("Enter interactiveMode (true/false): ", "false")
if canceled_interactive then
return
end
-- Format perintah Maven berdasarkan input pengguna
local command = string.format(
[[mvn archetype:generate "-DgroupId=%s" "-DartifactId=%s" "-DarchetypeArtifactId=%s" "-DarchetypeVersion=%s" "-DinteractiveMode=%s"]],
group_id,
artifact_id,
archetype_artifact_id,
archetype_version,
interactive_mode
)
-- Fungsi untuk menjalankan perintah Maven dan menampilkan outputnya
local function run_maven_command(cmd, project_name)
local output = vim.fn.system(cmd)
if vim.v.shell_error ~= 0 then
print("Erro ao executar: " .. output)
else
local ch_dir = string.format("cd %s", project_name)
vim.fn.system(ch_dir)
vim.fn.chdir(project_name)
-- Cari dan buka file main class
local uname = vim.loop.os_uname().sysname
if uname == "Windows_NT" then
if group_id then
group_id = group_id:gsub("%.", "\\")
local main_class_path = string.format("src\\main\\java\\%s\\App.java", group_id)
if vim.fn.filereadable(main_class_path) == 1 then
vim.cmd(":edit " .. main_class_path)
end
end
else
if group_id then
group_id = group_id:gsub("%.", "/")
local main_class_path = string.format("src/main/java/%s/App.java", group_id)
if vim.fn.filereadable(main_class_path) == 1 then
vim.cmd(":edit " .. main_class_path)
end
end
end
vim.cmd(":NvimTreeFindFileToggl<CR>")
end
end
-- Jalankan perintah Maven dan buka proyek
run_maven_command(command, artifact_id)
create_notif("Project created successfully !", "info")
end
vim.api.nvim_create_user_command("MavenNewProject", mvn_new_project, {})

View file

@ -0,0 +1,289 @@
local function create_notif(message, level)
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify(message, level)
else
print(message)
end
end
local function safe_request(url)
local status, request = pcall(function()
return vim.system({ "curl", "-s", url }, { text = true }):wait()
end)
if not status then
vim.api.nvim_err_writeln("Error making request to " .. url .. ": " .. request)
return nil
end
return request
end
local function safe_json_decode(data)
local status, decoded = pcall(vim.fn.json_decode, data)
if not status then
vim.api.nvim_err_writeln("Error decoding JSON: " .. decoded)
return nil
end
return decoded
end
local function contains(list, element)
for _, value in pairs(list) do
if value == element then
return true
end
end
return false
end
local function list_to_string(list, is_err)
local result = ""
for i, value in ipairs(list) do
if is_err then
result = result .. "'" .. tostring(value) .. "'"
else
result = result .. tostring(value)
end
if i < #list then
if is_err then
result = result .. " or "
else
result = result .. "/"
end
end
end
return result
end
local function handle_start_springboot_data(data)
local spring_data = {}
for _, value in pairs(data.values) do
table.insert(spring_data, value.id)
end
return spring_data
end
local function change_directory()
-- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan
local function get_user_input(prompt, default_value)
vim.fn.inputsave()
local result = vim.fn.input(prompt, default_value)
vim.fn.inputrestore()
-- Cek apakah pengguna menekan Esc untuk membatalkan input
if result == "" then
create_notif("Input canceled.", "info")
return nil, true
end
return result, false
end
-- Ambil input dari pengguna untuk menentukan direktori proyek
local project_dir, canceled = get_user_input("Enter project directory: ", vim.fn.getcwd())
if canceled then
return
end
-- Buat direktori jika belum ada
if vim.fn.isdirectory(project_dir) == 0 then
if vim.fn.mkdir(project_dir, "p") == 0 then
create_notif("Failed to create project directory: " .. project_dir, "error")
return
end
end
-- Pindah ke direktori proyek
local success, err = pcall(vim.fn.chdir, project_dir)
if not success then
create_notif("Error changing directory: " .. err, "error")
return
end
create_notif("Changed directory to: " .. project_dir, "info")
return project_dir
end
local function get_build_type(data_available)
local build_type_available = list_to_string(data_available, false)
local options_err = list_to_string(data_available, true)
local build_type = vim.fn.input("Enter build type (" .. build_type_available .. "): ", "maven")
if not contains(data_available, build_type) then
create_notif("Invalid build type. Please enter " .. options_err .. ".", "info")
return ""
end
return build_type
end
local function get_language(data_available)
local language_available = list_to_string(data_available, false)
local options_err = list_to_string(data_available, true)
local language = vim.fn.input("Enter Language (" .. language_available .. "): ", "java")
if not contains(data_available, language) then
create_notif("Invalid language. Please enter " .. options_err .. ".", "info")
return ""
end
return language
end
local function get_java_version(data_available)
local version_available = list_to_string(data_available, false)
local options_err = list_to_string(data_available, true)
local java_version = vim.fn.input("Enter Java Version (" .. version_available .. "): ", "21")
if not contains(data_available, java_version) then
create_notif("Invalid Java version. Please enter a valid version " .. options_err .. ".", "info")
return ""
end
return java_version
end
local function get_boot_version(data_available)
local version_available = list_to_string(data_available, false)
local options_err = list_to_string(data_available, true)
local versions_table = {}
for v in string.gmatch(version_available, "([^/]+)") do
table.insert(versions_table, "-> " .. v)
end
local annotated_versions = table.concat(versions_table, "\n")
local boot_version = vim.fn.input(annotated_versions .. "\n: ", "3.3.5.RELEASE")
if not contains(data_available, boot_version) then
create_notif("Invalid Spring Boot version. Please enter a valid version " .. options_err .. ".", "info")
return ""
end
return boot_version
end
local function get_packaging(data_available)
local packaging_available = list_to_string(data_available, false)
local options_err = list_to_string(data_available, true)
local packaging = vim.fn.input("Enter Packaging(" .. packaging_available .. "): ", "jar")
if packaging ~= "jar" and packaging ~= "war" then
create_notif("Invalid packaging. Please enter " .. options_err .. ".", "info")
return ""
end
return packaging
end
local function springboot_new_project()
local request = safe_request("https://start.spring.io/metadata/client")
if not request then
vim.api.nvim_err_writeln("Failed to make a request to the URL.")
return false
end
local springboot_data = safe_json_decode(request.stdout)
if not springboot_data then
vim.api.nvim_err_writeln("Failed to decode JSON from the request.")
return false
end
local project_dir = change_directory()
local build_types = { "maven", "gradle" }
local languages = handle_start_springboot_data(springboot_data.language)
local java_versions = handle_start_springboot_data(springboot_data.javaVersion)
local boot_versions = handle_start_springboot_data(springboot_data.bootVersion)
local packagings = handle_start_springboot_data(springboot_data.packaging)
local build_type = get_build_type(build_types)
if build_type:len() == 0 then
return
end
local language = get_language(languages)
if language:len() == 0 then
return
end
local java_version = get_java_version(java_versions)
if java_version:len() == 0 then
return
end
local boot_version = get_boot_version(boot_versions)
if boot_version:len() == 0 then
return
end
local packaging = get_packaging(packagings)
if packaging:len() == 0 then
return
end
local dependencies = vim.fn.input("Enter dependencies (comma separated): ", "devtools,web,data-jpa,h2,thymeleaf")
local group_id = vim.fn.input("Enter Group ID: ", "com.example")
local artifact_id = vim.fn.input("Enter Artifact ID: ", "myproject")
local name = vim.fn.input("Enter project name: ", artifact_id)
local package_name = vim.fn.input("Enter package name: ", group_id .. "." .. artifact_id)
local description = vim.fn.input("Enter project description: ", "")
local command = string.format(
"spring init --boot-version=%s --java-version=%s --dependencies=%s --groupId=%s --artifactId=%s --name=%s --package-name=%s --description=%s --language=%s --build=%s %s",
boot_version,
java_version,
dependencies,
group_id,
artifact_id,
name,
package_name,
description, -- Menambahkan deskripsi proyek
language, -- Menambahkan bahasa pemrograman (Java, Kotlin, atau Groovy)
build_type,
name
)
-- Fungsi untuk mengubah teks
local function capitalize_first_letter(str)
return str:sub(1, 1):upper() .. str:sub(2):lower()
end
local output = vim.fn.system(command)
if vim.v.shell_error ~= 0 then
create_notif("Erro ao executar: " .. output, "error")
else
local ch_dir = string.format("cd %s", project_dir .. "/" .. name)
vim.fn.system(ch_dir)
vim.fn.chdir(project_dir .. "/" .. name)
create_notif(name, "info")
-- Cari dan buka file main class
local uname = vim.loop.os_uname().sysname
local pth = package_name
if uname == "Windows_NT" then
if pth then
pth = pth:gsub("%.", "\\")
create_notif(pth, "info")
local main_class_path =
string.format("src\\main\\java\\%s\\" .. capitalize_first_letter(name) .. "Application.java", pth)
create_notif(main_class_path, "info")
if vim.fn.filereadable(main_class_path) == 1 then
vim.cmd(":edit " .. main_class_path)
end
end
else
if pth then
pth = pth:gsub("%.", "/")
local main_class_path =
string.format("src/main/java/%s/" .. capitalize_first_letter(name) .. "Application.java", pth)
if vim.fn.filereadable(main_class_path) == 1 then
vim.cmd(":edit " .. main_class_path)
end
end
end
vim.cmd(":NvimTreeFindFileToggl<CR>")
end
create_notif("Project created successfully!", "info")
end
vim.api.nvim_create_user_command("SpringBootNewProject", springboot_new_project, {})

View file

@ -0,0 +1,106 @@
local function create_java_class()
local is_maven_project = function()
if vim.fn.findfile("pom.xml", vim.fn.getcwd()) == "pom.xml" then
return true
else
return false
end
end
local function create_notif(message, level)
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify(message, level)
else
print(message)
end
end
-- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan
local function get_user_input(prompt, default_value)
vim.fn.inputsave()
local result = vim.fn.input(prompt, default_value)
vim.fn.inputrestore()
-- Cek apakah pengguna menekan Esc untuk membatalkan input
if result == "" then
create_notif("Input canceled.", "info")
return nil, true
end
return result, false
end
-- Fungsi untuk mendapatkan nama package default berdasarkan buffer aktif
local function get_default_package()
local path = vim.fn.expand("%:p:h")
local project_root = vim.fn.getcwd()
local relative_path = path:sub(#project_root + 1)
relative_path = relative_path:gsub("app\\src\\main\\java\\", "")
relative_path = relative_path:gsub("src\\main\\java\\", "")
relative_path = relative_path:gsub("app/src/main/java/", "")
relative_path = relative_path:gsub("src/main/java/", "")
relative_path = relative_path:gsub("\\", ".")
relative_path = relative_path:gsub("/", ".")
return relative_path:sub(2)
end
-- Ambil input dari pengguna untuk nama package dan nama kelas
local package_name, canceled_package = get_user_input("Enter package name: ", get_default_package())
if canceled_package then
return
end
local class_name, canceled_class = get_user_input("Enter class name: ", "MyClass")
if canceled_class then
return
end
-- Format direktori dan path file berdasarkan input pengguna
local package_dir = nil
if package_name then
if is_maven_project() then
package_dir = string.format("src/main/java/%s", package_name:gsub("%.", "/"))
else
package_dir = string.format("app/src/main/java/%s", package_name:gsub("%.", "/"))
end
if vim.fn.isdirectory(package_dir) == 0 then
vim.fn.mkdir(package_dir, "p")
end
else
create_notif("Invalid package name: " .. package_name, "error")
return
end
local file_path = string.format("%s/%s.java", package_dir, class_name)
if vim.fn.filereadable(file_path) == 1 then
create_notif("Class already exists: " .. file_path, "error")
return
end
-- Tulis konten kelas Java ke dalam file
local class_content = string.format(
[[
package %s;
public class %s {
}
]],
package_name,
class_name,
class_name
)
local file = io.open(file_path, "w")
if file then
file:write(class_content)
file:close()
end
-- Buka file Java yang baru dibuat di Neovim
vim.cmd(":edit " .. file_path)
create_notif("Java class created: " .. file_path, "info")
end
vim.api.nvim_create_user_command("CreateJavaClass", create_java_class, {})

View file

@ -0,0 +1,109 @@
local function create_java_class()
local function create_notif(message, level)
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify(message, level)
else
print(message)
end
end
local is_maven_project = function()
if vim.fn.findfile("pom.xml", vim.fn.getcwd()) == "pom.xml" then
return true
else
return false
end
end
-- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan
local function get_user_input(prompt, default_value)
vim.fn.inputsave()
local result = vim.fn.input(prompt, default_value)
vim.fn.inputrestore()
-- Cek apakah pengguna menekan Esc untuk membatalkan input
if result == "" then
create_notif("Input canceled.", "info")
return nil, true
end
return result, false
end
-- Fungsi untuk mendapatkan nama package default berdasarkan buffer aktif
local function get_default_package()
local path = vim.fn.expand("%:p:h")
local project_root = vim.fn.getcwd()
local relative_path = path:sub(#project_root + 1)
relative_path = relative_path:gsub("app\\src\\main\\java\\", "")
relative_path = relative_path:gsub("src\\main\\java\\", "")
relative_path = relative_path:gsub("app/src/main/java/", "")
relative_path = relative_path:gsub("src/main/java/", "")
relative_path = relative_path:gsub("\\", ".")
relative_path = relative_path:gsub("/", ".")
return relative_path:sub(2)
end
-- Ambil input dari pengguna untuk nama package dan nama kelas
local package_name, canceled_package = get_user_input("Enter package name: ", get_default_package())
if canceled_package then
return
end
local class_name, canceled_class = get_user_input("Enter interface name: ", "MyInterface")
if canceled_class then
return
end
-- Format direktori dan path file berdasarkan input pengguna
local package_dir = nil
if package_name then
if is_maven_project() then
package_dir = string.format("src/main/java/%s", package_name:gsub("%.", "/"))
else
package_dir = string.format("app/src/main/java/%s", package_name:gsub("%.", "/"))
end
if vim.fn.isdirectory(package_dir) == 0 then
vim.fn.mkdir(package_dir, "p")
end
else
create_notif("Invalid package name: " .. package_name, "error")
return
end
local file_path = string.format("%s/%s.java", package_dir, class_name)
if vim.fn.filereadable(file_path) == 1 then
create_notif("Class already exists: " .. file_path, "error")
return
end
-- Tulis konten kelas Java ke dalam file
local class_content = string.format(
[[
/*
* This Java source file.
*/
package %s;
public interface %s {
// Other methods and fields
}
]],
package_name,
class_name,
class_name
)
local file = io.open(file_path, "w")
if file then
file:write(class_content)
file:close()
end
-- Buka file Java yang baru dibuat di Neovim
vim.cmd(":edit " .. file_path)
create_notif("Java interface created: " .. file_path, "info")
end
vim.api.nvim_create_user_command("CreateJavaInterface", create_java_class, {})

View file

@ -0,0 +1,115 @@
local function create_java_main_class()
local function create_notif(message, level)
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify(message, level)
else
print(message)
end
end
local is_maven_project = function()
if vim.fn.findfile("pom.xml", vim.fn.getcwd()) == "pom.xml" then
return true
else
return false
end
end
-- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan
local function get_user_input(prompt, default_value)
vim.fn.inputsave()
local result = vim.fn.input(prompt, default_value)
vim.fn.inputrestore()
-- Cek apakah pengguna menekan Esc untuk membatalkan input
if result == "" then
create_notif("Input canceled.", "info")
return nil, true
end
return result, false
end
-- Fungsi untuk mendapatkan nama package default berdasarkan buffer aktif
local function get_default_package()
local path = vim.fn.expand("%:p:h")
local project_root = vim.fn.getcwd()
local relative_path = path:sub(#project_root + 1)
relative_path = relative_path:gsub("app\\src\\main\\java\\", "")
relative_path = relative_path:gsub("src\\main\\java\\", "")
relative_path = relative_path:gsub("app/src/main/java/", "")
relative_path = relative_path:gsub("src/main/java/", "")
relative_path = relative_path:gsub("\\", ".")
relative_path = relative_path:gsub("/", ".")
return relative_path:sub(2)
end
-- Ambil input dari pengguna untuk nama package dan nama kelas
local package_name, canceled_package = get_user_input("Enter package name: ", get_default_package())
if canceled_package then
return
end
local class_name, canceled_class = get_user_input("Enter class name: ", "MyMainClass")
if canceled_class then
return
end
-- Format direktori dan path file berdasarkan input pengguna
local package_dir = nil
if package_name then
if is_maven_project() then
package_dir = string.format("src/main/java/%s", package_name:gsub("%.", "/"))
else
package_dir = string.format("app/src/main/java/%s", package_name:gsub("%.", "/"))
end
if vim.fn.isdirectory(package_dir) == 0 then
vim.fn.mkdir(package_dir, "p")
end
else
create_notif("Invalid package name: " .. package_name, "error")
return
end
local file_path = string.format("%s/%s.java", package_dir, class_name)
if vim.fn.filereadable(file_path) == 1 then
create_notif("Class already exists: " .. file_path, "error")
return
end
-- Tulis konten kelas Java ke dalam file
local class_content = string.format(
[[
/*
* This Java source file.
*/
package %s;
public class %s {
/**
*
*/
public static void main(String[] args) {
System.out.println("Hello World");
}
}
]],
package_name,
class_name,
class_name
)
local file = io.open(file_path, "w")
if file then
file:write(class_content)
file:close()
end
-- Buka file Java yang baru dibuat di Neovim
vim.cmd(":edit " .. file_path)
create_notif("Java class created: " .. file_path, "info")
end
vim.api.nvim_create_user_command("CreateJavaMainClass", create_java_main_class, {})

15
lua/auto-jdtls2/init.lua Normal file
View file

@ -0,0 +1,15 @@
local M = {}
M.setup = function(opt)
opt = opt or {}
require("auto-jdtls2.create_gradle_project")
require("auto-jdtls2.create_maven_project")
require("auto-jdtls2.create_springboot_project")
require("auto-jdtls2.generate_java_class")
require("auto-jdtls2.generate_java_interface")
require("auto-jdtls2.generate_java_main_class")
-- require("auto-jdtls2.utils").install()
-- require("auto-jdtls2.utils").attach_jdtls(opt)
end
return M

449
lua/auto-jdtls2/utils.lua Normal file
View file

@ -0,0 +1,449 @@
local M = {}
M.java_filetypes = { "java" }
M.root_markers = { ".git", "mvnw", "gradlew", "pom.xml", "build.gradle" }
-- Utility function to extend or override a config table, similar to the way
-- that Plugin.opts works.
---@param config table
---@param custom function | table | nil
M.extend_or_override = function(config, custom, ...)
if type(custom) == "function" then
config = custom(config, ...) or config
elseif custom then
config = vim.tbl_deep_extend("force", config, custom) --[[@as table]]
end
return config
end
function M.capabilities()
local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
if status_ok then
return cmp_nvim_lsp.default_capabilities()
end
local CAPABILITIES = vim.lsp.protocol.make_client_capabilities()
CAPABILITIES.textDocument.completion.completionItem.snippetSupport = true
CAPABILITIES.textDocument.completion.completionItem.resolveSupport = {
properties = {
"documentation",
"detail",
"additionalTextEdits",
},
}
return CAPABILITIES
end
-- stylua: ignore
M.lsp_keymaps=function ()
vim.keymap.set({ "n", "v" }, "<leader>l", "", { desc = "LSP" })
-- Set vim motion for <Space> + l + h to show code documentation about the code the cursor is currently over if available
vim.keymap.set("n", "<leader>lh", vim.lsp.buf.hover, { desc = "Code Hover Documentation" })
-- Set vim motion for <Space> + l + d to go where the code/variable under the cursor was defined
vim.keymap.set("n", "<leader>ld", vim.lsp.buf.definition, { desc = "Code Goto Definition" })
-- Set vim motion for <Space> + l + a for display code action suggestions for code diagnostics in both normal and visual mode
vim.keymap.set({ "n", "v" }, "<leader>la", vim.lsp.buf.code_action, { desc = "Code Actions" })
-- Set vim motion for <Space> + l + r to display references to the code under the cursor
vim.keymap.set("n", "<leader>lr", require("telescope.builtin").lsp_references, { desc = "Code Goto References" })
-- Set vim motion for <Space> + l + i to display implementations to the code under the cursor
vim.keymap.set("n", "<leader>li", require("telescope.builtin").lsp_implementations, { desc = "Code Goto Implementations" })
-- Set a vim motion for <Space> + l + <Shift>R to smartly rename the code under the cursor
vim.keymap.set("n", "<leader>lR", vim.lsp.buf.rename, { desc = "Code Rename" })
-- Set a vim motion for <Space> + l + <Shift>D to go to where the code/object was declared in the project (class file)
vim.keymap.set("n", "<leader>lD", vim.lsp.buf.declaration, { desc = "Code Goto Declaration" })
end
M.is_maven_project = function()
if vim.fn.findfile("pom.xml", vim.fn.getcwd()) == "pom.xml" then
return true
else
return false
end
end
M.is_gradle_project = function()
if
vim.fn.findfile("build.gradle", vim.fn.getcwd()) == "build.gradle"
or vim.fn.findfile("settings.gradle", vim.fn.getcwd()) == "settings.gradle"
or vim.fn.findfile("gradlew", vim.fn.getcwd()) == "gradlew"
then
return true
else
return false
end
end
M.is_main_class = function()
local bufnr = vim.api.nvim_get_current_buf()
local content = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
for i, line in ipairs(content) do
if line:match("public static void main%s*%(") then
return true
end
end
return false
end
M.run_aven_pring_boot = function()
if M.is_maven_project() then
vim.cmd("terminal mvn spring-boot:run")
else
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify("Project pom.xml not found !", "info")
else
print("Project pom.xml not found !")
end
end
end
M.cmd_maven_spring_boot = function()
vim.api.nvim_create_user_command("RunMvnSpringBoot", function()
M.run_aven_pring_boot()
end, { nargs = 0 })
end
M.run_gradle_spring_boot = function()
if M.is_gradle_project() then
local uname = vim.loop.os_uname().sysname
if uname == "Windows_NT" then
vim.cmd("terminal .\\gradlew build --continuous")
vim.cmd("terminal .\\gradlew bootRun")
else
vim.cmd("terminal ./gradlew build --continuous")
vim.cmd("terminal ./gradlew bootRun")
end
else
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify("Project build.gradle not found !", "info")
else
print("Project build.gradle not found !")
end
end
end
M.cmd_gradle_spring_boot = function()
vim.api.nvim_create_user_command("RunGradleSpringBoot", function()
M.run_gradle_spring_boot()
end, { nargs = 0 })
end
M.run_mvn_and_java = function()
if M.is_maven_project() then
local result = M.is_main_class()
if not result then
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify("Please open java main class !", "info")
else
print("Please open java main class !")
end
return
else
-- Fungsi untuk mencari file .jar dalam folder target
local function find_jar_file()
local target_dir = "target"
local jar_file = nil
local handle = vim.loop.fs_scandir(target_dir)
if handle then
while true do
local name, t = vim.loop.fs_scandir_next(handle)
if not name then
break
end
if t == "file" and name:match("%.jar$") then
jar_file = name
break
end
end
end
return jar_file
end
local jar_file = find_jar_file()
-- Buat fungsi untuk menjalankan perintah secara berurutan dalam mode diam
function RunMvnAndJava()
-- daptkan path
local root = vim.uv.cwd()
local fname = vim.api.nvim_buf_get_name(0)
fname = fname:gsub(root, "")
fname = fname:gsub("/src/main/java/", "")
fname = fname:gsub("\\src\\main\\java\\", "")
fname = fname:gsub(".java", ""):gsub("/", ".")
fname = fname:gsub("\\", ".")
-- Jalankan perintah mvn package secara diam-diam
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify("Compile Start !", "info")
end
vim.fn.jobstart("mvn package", {
on_exit = function()
vim.cmd("terminal java -cp target/" .. jar_file .. " " .. fname)
end,
})
end
RunMvnAndJava()
end
else
local notif_ok, notify = pcall(require, "notify")
if notif_ok then
notify("Project pom.xml not found !", "info")
else
print("Project pom.xml not found !")
end
end
end
M.cmd_mvn_and_java = function()
vim.api.nvim_create_user_command("RunMaven", function()
M.run_mvn_and_java()
end, { nargs = 0 })
end
M.cmd_gradle = function()
vim.api.nvim_create_user_command("RunGradle", function()
vim.cmd("terminal gradle run")
end, { nargs = 0 })
end
-- stylua: ignore
M.jdtls_keymaps=function ()
-- add keymaps
vim.keymap.set('n', '<leader>J', "", { desc = "Java" })
-- Set a Vim motion to <Space> + <Shift>J + o to organize imports in normal mode
vim.keymap.set('n', '<leader>Jo', "<Cmd> lua require('jdtls').organize_imports()<CR>", { desc = "Java Organize Imports" })
-- Set a Vim motion to <Space> + <Shift>J + v to extract the code under the cursor to a variable
vim.keymap.set('n', '<leader>Jv', "<Cmd> lua require('jdtls').extract_variable()<CR>", { desc = "Java Extract Variable" })
-- Set a Vim motion to <Space> + <Shift>J + v to extract the code selected in visual mode to a variable
vim.keymap.set('v', '<leader>Jv', "<Esc><Cmd> lua require('jdtls').extract_variable(true)<CR>", { desc = "Java Extract Variable" })
-- Set a Vim motion to <Space> + <Shift>J + <Shift>C to extract the code under the cursor to a static variable
vim.keymap.set('n', '<leader>JC', "<Cmd> lua require('jdtls').extract_constant()<CR>", { desc = "Java Extract Constant" })
-- Set a Vim motion to <Space> + <Shift>J + <Shift>C to extract the code selected in visual mode to a static variable
vim.keymap.set('v', '<leader>JC', "<Esc><Cmd> lua require('jdtls').extract_constant(true)<CR>", { desc = "Java Extract Constant" })
-- Set a Vim motion to <Space> + <Shift>J + t to run the test method currently under the cursor
vim.keymap.set('n', '<leader>Jt', "<Cmd> lua require('jdtls').test_nearest_method()<CR>", { desc = "Java Test Method" })
-- Set a Vim motion to <Space> + <Shift>J + t to run the test method that is currently selected in visual mode
vim.keymap.set('v', '<leader>Jt', "<Esc><Cmd> lua require('jdtls').test_nearest_method(true)<CR>", { desc = "Java Test Method" })
-- Set a Vim motion to <Space> + <Shift>J + <Shift>T to run an entire test suite (class)
vim.keymap.set('n', '<leader>JT', "<Cmd> lua require('jdtls').test_class()<CR>", { desc = "Java Test Class" })
-- Set a Vim motion to <Space> + <Shift>J + u to update the project configuration
vim.keymap.set('n', '<leader>Ju', "<Cmd> JdtUpdateConfig<CR>", { desc = "Java Update Config" })
end
M.opts = {
root_dir = require("jdtls.setup").find_root(M.root_markers),
project_name = function()
return vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
end,
get_jdtls = function()
local function check_os()
local uname = vim.loop.os_uname().sysname
if uname == "Darwin" then
return "mac"
elseif uname == "Windows_NT" then
return "win"
elseif uname == "Linux" then
return "linux"
else
return "unknown"
end
end
local mason_registry = require("mason-registry")
local jdtls = mason_registry.get_package("jdtls")
local jdtls_path = jdtls:get_install_path()
local launcher = vim.fn.glob(jdtls_path .. "/plugins/org.eclipse.equinox.launcher_*.jar")
local SYSTEM = check_os()
local config = jdtls_path .. "/config_" .. SYSTEM
local lombok = jdtls_path .. "/lombok.jar"
return launcher, config, lombok
end,
jdtls_workspace_dir = function(project_name)
local function get_workspace()
local home = os.getenv("HOME")
local workspace_path = home .. "/code/workspace/"
local workspace_dir = workspace_path .. project_name
return workspace_dir
end
return get_workspace()
end,
full_cmd = function(opts)
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
local launcher, os_config, lombok = opts.get_jdtls()
local cmd = {
"java",
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
"-Dosgi.bundles.defaultStartLevel=4",
"-Declipse.product=org.eclipse.jdt.ls.core.product",
"-Dlog.protocol=true",
"-Dlog.level=ALL",
"-Xmx1g",
"--add-modules=ALL-SYSTEM",
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang=ALL-UNNAMED",
"-javaagent:" .. lombok,
"-jar",
launcher,
"-configuration",
os_config,
"-data",
opts.jdtls_workspace_dir(project_name),
}
return cmd
end,
-- These depend on nvim-dap, but can additionally be disabled by setting false here.
dap = { hotcodereplace = "auto", config_overrides = {} },
dap_main = {},
test = true,
settings = {
java = {
inlayHints = {
parameterNames = {
enabled = "all",
},
},
},
},
}
M.attach_jdtls = function(op)
M.opts = M.extend_or_override(M.opts, op or {})
local opt = vim.opt
opt.shiftwidth = 4
opt.tabstop = 4
opt.softtabstop = 4
opt.ts = 4
opt.expandtab = true
-- Check Ttriisittrer
local function ensure_ts_install(lang)
local parsers = require("nvim-treesitter.parsers")
local installed = parsers.has_parser(lang)
if not installed then
vim.cmd("TSInstall " .. lang)
require("notify")("Treesitter parser for " .. lang .. " installed successfully.")
end
end
-- Memeriksa dan menginstal atau mengonfirmasi Treesitter untuk Java
ensure_ts_install("java")
local mason_registry = require("mason-registry")
if
not mason_registry.is_installed("jdtls")
or not mason_registry.is_installed("java-debug-adapter")
or not mason_registry.is_installed("java-test")
then
vim.cmd("Mason")
require("notify")("Mason Installed Dependency, please restart nvim after installation is completed")
return
end
local bundles = {} ---@type string[]
if M.opts.dap and mason_registry.is_installed("java-debug-adapter") then
local java_dbg_pkg = mason_registry.get_package("java-debug-adapter")
local java_dbg_path = java_dbg_pkg:get_install_path()
local jar_patterns = {
java_dbg_path .. "/extension/server/com.microsoft.java.debug.plugin-*.jar",
}
-- java-test also depends on java-debug-adapter.
if M.opts.test and mason_registry.is_installed("java-test") then
local java_test_pkg = mason_registry.get_package("java-test")
local java_test_path = java_test_pkg:get_install_path()
vim.list_extend(jar_patterns, {
java_test_path .. "/extension/server/*.jar",
})
end
for _, jar_pattern in ipairs(jar_patterns) do
for _, bundle in ipairs(vim.split(vim.fn.glob(jar_pattern), "\n")) do
table.insert(bundles, bundle)
end
end
end
-- initialisasi config
local function attach_jdtls()
-- load user cmd
M.cmd_maven_spring_boot()
M.cmd_gradle_spring_boot()
M.cmd_mvn_and_java()
M.cmd_gradle()
-- Configuration can be augmented and overridden by opts.jdtls
local config = M.extend_or_override({
cmd = M.opts.full_cmd(M.opts),
root_dir = require("jdtls.setup").find_root(M.root_markers),
init_options = {
bundles = bundles,
},
settings = M.opts.settings,
-- enable CMP capabilities
-- capabilities = require("user.lsp.handlers").capabilities or nil,
-- capabilities = require("auto-lsp.lsp.handlers").capabilities or nil,
capabilities = M.capabilities() or nil,
}, M.opts.jdtls)
-- Existing server will be reused if the root_dir matches.
require("jdtls").start_or_attach(config)
end
vim.api.nvim_create_autocmd("FileType", {
pattern = M.java_filetypes,
callback = attach_jdtls,
})
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
-- stylua: ignore
if client and client.name == "jdtls" then
-- M.jdtls_keymaps()
-- M.lsp_keymaps()
if M.opts.dap and mason_registry.is_installed("java-debug-adapter") then
-- custom init for Java debugger
require("jdtls").setup_dap(M.opts.dap)
require("jdtls.dap").setup_dap_main_class_configs(M.opts.dap_main)
end
-- User can set additional keymaps in opts.on_attach
if M.opts.on_attach then
M.opts.on_attach(args)
end
end
end,
})
attach_jdtls()
end
M.install = function()
local ensure_installed = {
"java-debug-adapter",
"java-test",
"jdtls",
}
local mr = require("mason-registry")
mr:on("package:install:success", function()
vim.defer_fn(function()
-- trigger FileType event to possibly load this newly installed LSP server
require("lazy.core.handler.event").trigger({
event = "FileType",
buf = vim.api.nvim_get_current_buf(),
})
end, 100)
end)
mr.refresh(function()
for _, tool in ipairs(ensure_installed) do
local p = mr.get_package(tool)
if not p:is_installed() then
p:install()
end
end
end)
end
return M

View file

@ -1,60 +0,0 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({
"git", "clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath
})
end
local icons = require("user.icons").ui
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.diagnostic.config({ virtual_lines = false })
require("lazy").setup({
spec = {
{ import = "plugins.themes" },
{ import = "plugins" },
{ import = "custom.plugins" },
},
defaults = {
lazy = true, -- every plugin is lazy-loaded by default
version = "*", -- try installing the latest stable version for plugins that support semver
},
ui = {
backdrop = 100,
border = "rounded",
browser = "chrome",
throttle = 40,
custom_keys = { ["<localleader>l"] = false },
icons = {
ft = icons.ft,
lazy = icons.Bell .. " ",
loaded = icons.CheckCircle,
not_loaded = icons.not_loaded,
},
},
change_detection = { enabled = false, notify = false },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
"lazyredraw",
},
},
},
})

View file

@ -1,22 +0,0 @@
_G.pcode = _G.pcode or {}
require("custom.default")
require("custom.dashboard")
require("config.lazy_lib")
require("user.colorscheme")
require("user.keymaps")
require("core.neovide")
require("custom.autocmd")
require("custom.keymaps")
-- require("user.snip")
-- require("user.nvim-tree")
-- require("user.options")
-- require("user.keymaps")
-- require("user.autocommands")
-- require("user.format_onsave")
-- require("user.snip")
-- require("user.bufferline")
-- require("user.chat_gpt")
-- vim.cmd("colorscheme one_monokai")
-- vim.cmd("colorscheme onedark")
-- vim.cmd("colorscheme github_dark_dimmed")
-- vim.cmd("colorscheme github_dark_high_contrast")

View file

@ -1,55 +0,0 @@
local transparent_mode = pcode.transparent_mode or 0
if transparent_mode ~= nil then
if transparent_mode == 1 then
vim.cmd("TransparentDisable")
vim.cmd("TransparentEnable")
end
end
-- get folder name from current directory
local _get_folder_name = function()
local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
return " " .. str:lower():gsub("^%l", string.upper) .. " "
end
local term_program = vim.fn.getenv("TERM_PROGRAM")
if term_program == "WezTerm" then
-- vim.cmd('silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"')
-- create autocmd on insertEnter
vim.api.nvim_create_autocmd("BufRead", {
group = vim.api.nvim_create_augroup("BufRead", { clear = true }),
command = 'silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"',
desc = "Set Folder Name",
})
end
vim.api.nvim_create_autocmd("ExitPre", {
group = vim.api.nvim_create_augroup("Exit", { clear = true }),
command = "set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175,a:ver90",
desc = "Set cursor back to beam when leaving Neovim.",
})
-- config for vim-visual-multi color selection
vim.g.VM_Mono_hl = "DiffText"
vim.g.VM_Extend_hl = "DiffAdd"
-- vim.g.VM_Cursor_hl = "Visual"
vim.g.VM_Cursor_hl = "DiffText"
vim.g.VM_Insert_hl = "DiffChange"
-- NvimTree automatically resize the floating window when neovim's window size changes
-- local tree_api = require("nvim-tree")
-- local tree_view = require("nvim-tree.view")
--
-- vim.api.nvim_create_augroup("NvimTreeResize", {
-- clear = true,
-- })
--
-- vim.api.nvim_create_autocmd({ "VimResized" }, {
-- group = "NvimTreeResize",
-- callback = function()
-- if tree_view.is_visible() then
-- tree_view.close()
-- tree_api.open()
-- end
-- end,
-- })

View file

@ -1,37 +0,0 @@
-- Untuk Ubah Dashboard
-- 1. Buka remark dash board dibawah
-- 2. Ubah dashboard sesuai keinginan dan kebutuhan
pcode.header1 = {
[[ _ __ __ ]],
[[ ___ ___ (____ / /__ _______ ___/ ___ ]],
[[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]],
[[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]],
[[ /_/ |___/ ]],
}
-- pcode.header2 = {
-- [[ __ ]],
-- [[ ___ ___ ___ __ __ /\_\ ___ ___ ]],
-- [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]],
-- [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
-- [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
-- [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
-- }
-- pcode.header1 = {
-- " ▄ ▄ ",
-- " ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ ",
-- " █ ▄ █▄█ ▄▄▄ █ █▄█ █ █ ",
-- " ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █ ",
-- " ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ",
-- " █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄",
-- "▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █",
-- "█▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █",
-- " █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█ ",
-- }
pcode.footer = "PCode"
-- 1 startify model
-- 2 dashboard model
pcode.model = 1 -- isi dengan 1 atau 2 untuk model dashboard

View file

@ -1,181 +0,0 @@
-- custom colorscheme
-- colorscheme ready :
-- tokyonight, tokyonight-night, tokyonight-storm, tokyonight-day, tokyonight-moon
-- gruvbox-baby (default)
-- sonokai, sonokai_atlantis,
-- sonokai_andromeda,sonokai_shusia,sonokai_maia,sonokai_espresso
-- material, material_deepocean, material_palenight, material_lighter, material_darker
-- onedark, onedark_vivid, onedark_dark
-- nord
-- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
-- dracula
-- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox
-- github_dark, github_dark_default, github_dark_colorblind, github_dark_dimmed
-- solarized-osaka
-- darcula-dark
-- juliana
pcode.colorscheme = "dracula"
-- 0 =off 1= on
pcode.transparent_mode = 0
-- https://github.com/nvim-lualine/lualine.nvim
-- rounded
-- roundedall
-- square
-- triangle
-- parallelogram
-- transparent
-- default
pcode.lualinetheme = "roundedall"
-- 0 disable progress
-- 1 lualine lsp progress
-- 2 fidget progress
pcode.progress = 1
-- 0 = on full text mode info,
-- 1 = on initial mode + logo
-- 2 = logo only
-- 3 = initial only
-- 4 = off
pcode.show_mode = 3
-- true or false
pcode.format_on_save = true
pcode.format_timeout_ms = 5000
-- https://github.com/mfussenegger/nvim-lint
-- https://github.com/stevearc/conform.nvim
-- use conform and nvim-lint if set true
pcode.disable_null_ls = true
pcode.treesitter_ensure_installed = {}
pcode.tscontext = false
-- ini hanya untuk lsp yg tidak support masson
-- untuk referesi support language kunjungi link dibawah
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
pcode.lsp_installer = {
-- "yamlls",
-- tambahkan di bawah sini setelah melakukan :masoninstall
}
-- use for lsp diagnostics virtual text
pcode.lsp_virtualtext = true
-- use for lsp ghost text config
pcode.lspghost_text = false
-- untuk referesi support language kunjungi link dibawah
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
pcode.mason_ensure_installed = { -- sebelumnya register_lsp
-- "yamlls",
-- tambahkan di bawah sini setelah melakukan :masoninstall
}
pcode.unregister_lsp = {
-- "jdtls", -- tambahkan di bawah ini
}
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md
pcode.null_ls_ensure_installed = {
"stylua",
}
-- dap instal hanya support linux dan mac
-- https://github.com/jay-babu/mason-nvim-dap.nvim/blob/main/lua/mason-nvim-dap/mappings/source.lua
-- atau gunakan :MasonInstall
pcode.dap_ensure_installed = {
-- "python",
}
-- https://github.com/folke/which-key.nvim
pcode.whichkey = {
-- contoh penambahan
["r"] = {
name = "  Run",
j = { "<cmd>Jaq float<CR>", "Run With Jaq" },
},
}
-- https://github.com/CRAG666/code_runner.nvim
-- ready default java, python, typescript, javascript, rust, cpp, scss
pcode.coderunner = {
go = "go run $fileName",
html = "live-server $dir/$fileName",
}
-- https://github.com/nvim-tree/nvim-tree.lua
-- 0 = normal
-- 1 = float
pcode.nvimtree_isfloat = 0
-- https://github.com/roobert/tailwindcss-colorizer-cmp.nvim
pcode.tailwindcolorizer = false
-- https://github.com/Exafunction/codeium.vim
pcode.codeium = false
-- https://github.com/Exafunction/codeium.nvim
pcode.codeium_nvim = true
-- https://github.com/kevinhwang91/nvim-ufo
pcode.nvimufo = false
-- https://github.com/echasnovski/mini.indentscope
pcode.indentscope = true
-- https://github.com/echasnovski/mini.animate
pcode.minianimate = false
-- https://github.com/hrsh7th/nvim-cmp
pcode.disable_cmpdoc = false
-- https://github.com/rachartier/tiny-devicons-auto-colors.nvim
pcode.adaptive_color_icon = true
-- https://github.com/lukas-reineke/virt-column.nvim
pcode.columnline = true
-- https://github.com/okuuva/auto-save.nvim
pcode.auto_save = false
-- https://github.com/folke/todo-comments.nvim
pcode.todo_comment = false
-- https://github.com/nvim-telescope/telescope.nvim
---@alias telescope_themes
---| "cursor" # see `telescope.themes.get_cursor()`
---| "dropdown" # see `telescope.themes.get_dropdown()`
---| "ivy" # see `telescope.themes.get_ivy()`
---| "center" # retain the default telescope theme
pcode.telescope_theme_find_file = "center"
pcode.telescope_theme_live_grep = "dropdown"
-- https://github.com/ThePrimeagen/refactoring.nvim
pcode.refactoring = false
-- https://github.com/kristijanhusak/vim-dadbod-ui
pcode.database = false
-- https://github.com/rest-nvim/rest.nvim
pcode.rest_client = true
-- https://github.com/mfussenegger/nvim-dap
pcode.nvim_dap = true -- not support for windows os (auto config mason-nvim-dap)
-- conefig special support test & dap
pcode.active_rust_config = false
pcode.active_javascript_config = {
active = false,
jest_command = "npm test -- ",
jest_config = "jest.config.mjs",
}
pcode.active_prisma_config = true
pcode.active_php_config = false
pcode.active_golang_config = false
pcode.active_python_config = false
pcode.active_cpp_config = false
pcode.active_java_config = {
active = false,
project = "gradle", -- gradle or maven
use_nvim_jdtls = true, -- mfussenegger/nvim-jdtls
}
pcode.active_deno_config = false
pcode.active_kotlin_config = false

View file

@ -1,11 +0,0 @@
local opts = { noremap = true, silent = true }
local keymap = vim.api.nvim_set_keymap
keymap("n", "]h", '<cmd>lua print("Testing")<cr>', opts)
keymap("n", "f", "<cmd>NvimTreeFindFileToggle<cr><cr><Up>", opts)
-- Allow clipboard copy paste in neovim
vim.api.nvim_set_keymap("", "<C-v>", "+p<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("!", "<C-v>", "<C-R>+", { noremap = true, silent = true })
vim.api.nvim_set_keymap("t", "<C-v>", "<C-R>+", { noremap = true, silent = true })
vim.api.nvim_set_keymap("v", "<C-v>", "<C-R>+", { noremap = true, silent = true })

View file

@ -1,10 +0,0 @@
local null_ls = require("null-ls")
local m = {
sources = {
-- null_ls.builtins.formatting.stylua, -- tambahkan di bawah sini
-- null_ls.builtins.formatting.clang_format.with({ filetypes = { "c", "cpp" } }),
--null_ls.builtins.diagnostics.flake8, -- tambahkan di bawah sini
--null_ls.builtins.formatting.blade_formatter.with({ filetypes = { "blade", "php" } }),
},
}
return m

View file

@ -1,161 +0,0 @@
-- initial gui app
local is_neovide = false
local use_noice = true
-- if vim.g.neovide then
-- is_neovide = true
-- use_noice = false
-- end
-- vim.opt.lazyredraw = is_neovide
return {
-- { "gelguy/wilder.nvim", enabled = not use_noice },
-- {
-- "folke/noice.nvim",
-- lazy = true,
-- enabled = use_noice,
-- dependencies = {
-- { "MunifTanjim/nui.nvim", enabled = use_noice },
-- },
-- -- event = "BufWinEnter",
-- event = "VeryLazy",
-- opts = {
-- messages = {
-- enabled = false,
-- },
-- notify = {
-- enabled = false,
-- },
-- lsp = {
-- progress = {
-- enabled = false,
-- },
-- hover = {
-- enabled = false,
-- },
-- signature = {
-- enabled = false,
-- },
-- },
-- },
-- init = function()
-- -- load if mode command mode
-- -- vim.api.nvim_create_autocmd("CmdlineEnter", {
-- -- callback = function()
-- -- require("lazy").load({ plugins = { "noice.nvim" } })
-- -- end,
-- -- })
-- -- require("lazy").load({ plugins = { "noice.nvim" } })
-- end,
-- keys = {
-- {
-- "<S-Enter>",
-- function()
-- require("noice").redirect(vim.fn.getcmdline())
-- end,
-- mode = "c",
-- desc = "Redirect Cmdline",
-- },
-- {
-- "<leader>snl",
-- function()
-- require("noice").cmd("last")
-- end,
-- desc = "Noice Last Message",
-- },
-- {
-- "<leader>snh",
-- function()
-- require("noice").cmd("history")
-- end,
-- desc = "Noice History",
-- },
-- {
-- "<leader>sna",
-- function()
-- require("noice").cmd("all")
-- end,
-- desc = "Noice All",
-- },
-- {
-- "<c-f>",
-- function()
-- if not require("noice.lsp").scroll(4) then
-- return "<c-f>"
-- end
-- end,
-- silent = true,
-- expr = true,
-- desc = "Scroll forward",
-- mode = { "i", "n", "s" },
-- },
-- {
-- "<c-b>",
-- function()
-- if not require("noice.lsp").scroll(-4) then
-- return "<c-b>"
-- end
-- end,
-- silent = true,
-- expr = true,
-- desc = "Scroll backward",
-- mode = { "i", "n", "s" },
-- },
-- },
-- },
-- {
-- "hrsh7th/cmp-cmdline",
-- event = "VeryLazy",
-- enabled = use_noice,
-- init = function()
-- -- load if mode command mode
-- -- vim.api.nvim_create_autocmd("CmdlineEnter", {
-- -- callback = function()
-- -- require("lazy").load({ plugins = { "cmp-cmdline" } })
-- -- end,
-- -- })
-- end,
-- config = function()
-- local cmp = require("cmp")
-- local mapping = {
-- ["<CR>"] = cmp.mapping.confirm({ select = true }),
-- ["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
-- ["<S-Tab>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
-- ["<Down>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
-- ["<Tab>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
-- }
--
-- -- Use buffer source for `/`.
-- cmp.setup.cmdline("/", {
-- preselect = "none",
-- completion = {
-- completeopt = "menu,preview,menuone,noselect",
-- },
-- mapping = mapping,
-- sources = {
-- { name = "buffer" },
-- },
-- experimental = {
-- ghost_text = true,
-- native_menu = false,
-- },
-- })
--
-- -- Use cmdline & path source for ':'.
-- cmp.setup.cmdline(":", {
-- preselect = "none",
-- completion = {
-- completeopt = "menu,preview,menuone,noselect",
-- },
-- mapping = mapping,
-- sources = cmp.config.sources({
-- { name = "path" },
-- }, {
-- { name = "cmdline" },
-- }),
-- experimental = {
-- ghost_text = true,
-- native_menu = false,
-- },
-- })
-- end,
-- },
}

View file

@ -1,16 +0,0 @@
return {
-- "soulis-1256/eagle.nvim",
-- event = "BufRead",
-- config = function()
-- require("eagle").setup()
-- vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter", "WinEnter" }, {
-- pattern = "*",
-- callback = function()
-- -- Aktifkan mousemoveevent untuk semua buffer kecuali NvimTree
-- if vim.fn.win_gettype() ~= "NvimTree" then
-- vim.o.mousemoveevent = true
-- end
-- end,
-- })
-- end,
}

View file

@ -1,60 +0,0 @@
return {
-- "nvim-telescope/telescope-file-browser.nvim",
-- dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
-- keys = {
-- {
-- "sf",
-- function()
-- local telescope = require "telescope"
--
-- local function telescope_buffer_dir()
-- return vim.fn.expand "%:p:h"
-- end
--
-- telescope.extensions.file_browser.file_browser {
-- path = "%:p:h",
-- cwd = telescope_buffer_dir(),
-- respect_gitignore = false,
-- hidden = true,
-- grouped = true,
-- previewer = false,
-- initial_mode = "insert",
-- layout_config = { height = 40 },
-- }
-- end,
-- desc = "Open File Browser with the path of the current buffer",
-- },
-- },
-- config = function(_, opts)
-- local telescope = require "telescope"
-- local actions = require "telescope.actions"
-- local fb_actions = require("telescope").extensions.file_browser.actions
-- opts.extensions = {
-- file_browser = {
-- theme = "dropdown",
-- -- disables netrw and use telescope-file-browser in its place
-- hijack_netrw = true,
-- mappings = {
-- -- your custom insert mode mappings
-- ["n"] = {
-- -- your custom normal mode mappings
-- ["N"] = fb_actions.create,
-- ["h"] = fb_actions.goto_parent_dir,
-- ["<C-u>"] = function(prompt_bufnr)
-- for i = 1, 10 do
-- actions.move_selection_previous(prompt_bufnr)
-- end
-- end,
-- ["<C-d>"] = function(prompt_bufnr)
-- for i = 1, 10 do
-- actions.move_selection_next(prompt_bufnr)
-- end
-- end,
-- },
-- },
-- },
-- }
-- telescope.setup(opts)
-- require("telescope").load_extension "file_browser"
-- end,
}

View file

@ -1,110 +0,0 @@
return {
-- {
-- "navarasu/onedark.nvim",
-- enabled = false,
-- },
-- {
-- "projekt0n/github-nvim-theme",
-- lazy = false, -- make sure we load this during startup if it is your main colorscheme
-- priority = 1000, -- make sure to load this before all the other start plugins
-- config = function()
-- local is_transparent = false
-- local palette = require("github-theme.palette").load("github_dark_dimmed")
-- require("github-theme").setup({
-- options = {
-- -- Compiled file's destination location
-- compile_path = vim.fn.stdpath("cache") .. "/github-theme",
-- compile_file_suffix = "_compiled", -- Compiled file suffix
-- hide_end_of_buffer = true, -- Hide the '~' character at the end of the buffer for a cleaner look
-- hide_nc_statusline = true, -- Override the underline style for non-active statuslines
-- transparent = is_transparent, -- Disable setting background
-- terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal`
-- dim_inactive = false, -- Non focused panes set to alternative background
-- module_default = true, -- Default enable value for modules
-- styles = { -- Style to be applied to different syntax groups
-- comments = "italic", -- Value is any valid attr-list value `:help attr-list`
-- functions = "italic",
-- keywords = "NONE",
-- variables = "NONE",
-- conditionals = "NONE",
-- constants = "NONE",
-- numbers = "NONE",
-- operators = "NONE",
-- strings = "NONE",
-- types = "NONE",
-- },
-- inverse = { -- Inverse highlight for different types
-- match_paren = false,
-- visual = false,
-- search = false,
-- },
-- darken = { -- Darken floating windows and sidebar-like windows
-- floats = false,
-- sidebars = {
-- enabled = true,
-- list = {}, -- Apply dark background to specific windows
-- },
-- },
-- modules = { -- List of various plugins and additional options
-- -- ...
-- },
-- },
-- palettes = {
-- github_dark_dimmed = {
-- bg0 = is_transparent and "NONE" or "bg1",
-- bg1 = is_transparent and "NONE" or "bg",
-- },
-- },
-- specs = {},
-- groups = {
-- all = {
-- illuminatedWord = { bg = "#3b4261" },
-- illuminatedCurWord = { bg = "#3b4261" },
-- IlluminatedWordText = { bg = "#3b4261" },
-- IlluminatedWordRead = { bg = "#3b4261" },
-- IlluminatedWordWrite = { bg = "#3b4261" },
-- ["@tag.attribute"] = { fg = "#77bdfb", style = "italic" },
-- ["@text.uri"] = { fg = palette.const, style = "italic" },
-- ["@keyword.return"] = { fg = "#fa7970", style = "italic" },
-- -- ["@tag.attribute.html"] = { fg = "#faa356", style = "italic" },
-- -- ["@operator.html"] = { fg = "#faa356" },
-- -- ["@tag.html"] = { fg = "#fa7970" },
-- -- ["@tag.delimiter.html"] = { fg = "#faa356" },
-- -- ["@tag.javascript"] = { fg = "#faa356" },
-- -- ["@tag.javascript"] = { fg = "#8ddb8c" },
-- -- ["@tag.tsx"] = { fg = "#8ddb8c" },
-- ["@string.special.url"] = { fg = palette.const, style = "italic" },
-- ["@tag.delimiter.javascript"] = { fg = "fg1" },
-- ["@tag.tsx"] = { fg = "#faa356" },
-- ["@lsp.type.parameter"] = { fg = "#faa356" },
-- ["@property.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" },
-- ["@lsp.type.property.lua"] = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
-- ["@lsp.type.variable.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" },
-- },
-- github_dark_high_contrast = {
-- NvimTreeSpecialFile = { fg = "#faa356", style = "italic" },
-- },
-- github_dark_dimmed = {
-- -- As with specs and palettes, a specific style's value will be used over the `all`'s value.
-- NvimTreeNormal = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
-- NvimTreeSpecialFile = { fg = "#faa356", style = "italic" },
-- NvimTreeIndentMarker = { fg = "#3E4450" },
-- BufferLineFill = { bg = is_transparent and "NONE" or "bg1" },
-- BufferLineUnfocusedFill = { bg = is_transparent and "NONE" or "bg1" },
-- LualineNormal = { bg = is_transparent and "NONE" or "bg1" },
-- StatusLine = { bg = is_transparent and "NONE" or "bg1" },
-- StatusLineTerm = { bg = is_transparent and "NONE" or "bg1" },
-- Pmenu = { bg = is_transparent and "NONE" or "bg1" },
-- PmenuSel = { link = "CursorLine" },
-- WhichKeyFloat = { bg = is_transparent and "NONE" or "bg1" },
-- LazyNormal = { bg = is_transparent and "NONE" or "bg1" },
-- LazyBackground = { bg = is_transparent and "NONE" or "bg1" },
-- NormalSB = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" }, -- normal text
-- NormalFloat = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
-- IblIndent = { fg = "#3E4450" },
-- },
-- },
-- })
-- end,
-- },
}

View file

@ -1,9 +0,0 @@
return {
-- {
-- "https://github.com/adelarsq/image_preview.nvim",
-- event = "VeryLazy",
-- config = function()
-- require("image_preview").setup()
-- end,
-- },
}

View file

@ -1,153 +0,0 @@
local icons = vim.g.pcode_icons
return {
--- masukan plugin tambahan disini
-- {
-- "folke/trouble.nvim",
-- event = "BufRead",
-- cmd = { "TroubleToggle", "Trouble" },
-- opts = { use_diagnostic_signs = true },
-- keys = {
-- {
-- "<leader>xx",
-- "<cmd>TroubleToggle document_diagnostics<cr>",
-- desc = "Document Diagnostics (Trouble)",
-- },
-- {
-- "<leader>xX",
-- "<cmd>TroubleToggle workspace_diagnostics<cr>",
-- desc = "Workspace Diagnostics (Trouble)",
-- },
-- },
-- },
-- {
-- "echasnovski/mini.indentscope",
-- version = false, -- wait till new 0.7.0 release to put it back on semver
-- event = "BufReadPre",
-- opts = {
-- -- symbol = "▏",
-- -- symbol = "│",
-- symbol = icons.ui.LineMiddle,
-- options = { try_as_border = true },
-- },
-- config = function(_, opts)
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = { "help", "alpha", "dashboard", "NvimTree", "Trouble", "lazy", "mason" },
-- callback = function()
-- vim.b.miniindentscope_disable = true
-- end,
-- })
-- require("mini.indentscope").setup(opts)
-- end,
-- },
-- {
-- "hrsh7th/cmp-nvim-lua",
-- enabled = false,
-- },
-- {
-- "gbprod/yanky.nvim",
-- event = "BufReadPre",
-- config = function()
-- require("user.yanky")
-- end,
-- },
-- {
-- "is0n/jaq-nvim",
-- event = "BufRead",
-- config = function()
-- require("user.jaq")
-- end,
-- },
-- better todo coloring and icon
-- {
-- "folke/todo-comments.nvim",
-- event = { "BufReadPost", "BufNewFile" },
-- config = function()
-- require("todo-comments").setup()
-- end,
-- },
-- mini scrollview
-- {
-- "karb94/neoscroll.nvim",
-- event = "BufRead",
-- config = function()
-- require("user.neoscroll")
-- end,
-- },
-- { "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6", event = "VeryLazy" }, --
-- additional plugins
-- makes some plugins dot-repeatable like leap
-- { "tpope/vim-repeat", event = "VeryLazy" },
-- better diagnostics list and others
-- for markdown preview
-- make sure already install npm and yarn
-- {
-- "iamcco/markdown-preview.nvim",
-- event = "VeryLazy",
-- build = "cd app && npm install",
-- init = function()
-- vim.g.mkdp_filetypes = { "markdown" }
-- end,
-- ft = { "markdown" },
-- cmd = { "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" },
-- },
-- for codeGPT
-- {
-- "jackMort/ChatGPT.nvim",
-- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" },
-- lazy = true,
-- event = "VeryLazy",
-- -- opts = function()
-- -- require("user.chat_gpt")
-- -- end,
-- },
-- indent detection
-- {
-- "Darazaki/indent-o-matic",
-- event = "VeryLazy",
-- opt = true,
-- cmd = { "IndentOMatic" },
-- config = function()
-- require("user.indent-o-matic")
-- end,
-- },
-- Khusus Projek laravel baru di buka
-- {
-- "adalessa/laravel.nvim",
-- dependencies = {
-- "nvim-telescope/telescope.nvim",
-- },
-- cmd = { "Sail", "Artisan", "Composer" },
-- keys = {
-- { "<leader>pa", ":Artisan<cr>" },
-- },
-- config = function()
-- require("laravel").setup()
-- require("telescope").load_extension("laravel")
-- end,
-- },
-- --
-- {
-- "barrett-ruth/live-server.nvim",
-- build = "yarn global add live-server",
-- config = true,
-- init = function()
-- require("live-server").setup({
-- -- Arguments passed to live-server via `vim.fn.jobstart()`
-- -- Run `live-server --help` to see list of available options
-- -- For example, to use port 7000 and browser firefox:
-- args = { "--port=7000", "--browser=firefox" },
-- --args = {},
-- })
-- end,
-- },
-- for install lsp tidak support mason
-- {
-- "williamboman/nvim-lsp-installer",
-- event = "BufRead",
-- lazy = true,
-- config = function()
-- require("user.lsp.config")
-- end,
-- },
}

View file

@ -1,3 +0,0 @@
return {
-- { "mfussenegger/nvim-jdtls", event = "BufRead" },
}

View file

@ -1,20 +0,0 @@
return {
-- "ErichDonGubler/lsp_lines.nvim",
-- event = "BufRead",
-- config = function()
-- require("lsp_lines").setup()
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = { "*" }, --ini untuk file yang tidak ingin dibaca
-- callback = function()
-- local exclude_ft = {
-- "lazy",
-- }
-- if vim.tbl_contains(exclude_ft, vim.o.filetype) then
-- vim.diagnostic.config({ virtual_lines = false })
-- else
-- vim.diagnostic.config({ virtual_lines = true })
-- end
-- end,
-- })
-- end,
}

View file

@ -1,243 +0,0 @@
return {
-- {
-- "nvim-lualine/lualine.nvim",
-- event = "InsertEnter",
-- config = function()
-- local hide_in_width = function()
-- return vim.fn.winwidth(0) > 80
-- end
-- local icons = require("user.icons")
--
-- local getLeftSubstring = function(word, length)
-- if #word > length then
-- return string.sub(word, 1, length) .. "..."
-- else
-- return word
-- end
-- end
--
-- -- start for lsp
-- local list_registered_providers_names = function(filetype)
-- local s = require("null-ls.sources")
-- local available_sources = s.get_available(filetype)
-- local registered = {}
-- for _, source in ipairs(available_sources) do
-- for method in pairs(source.methods) do
-- registered[method] = registered[method] or {}
-- table.insert(registered[method], source.name)
-- end
-- end
-- return registered
-- end
--
-- local null_ls = require("null-ls")
-- -- for formatter
-- local list_registered = function(filetype)
-- local method = null_ls.methods.FORMATTING
-- local registered_providers = list_registered_providers_names(filetype)
-- return registered_providers[method] or {}
-- end
--
-- --- for linter
-- local alternative_methods = {
-- null_ls.methods.DIAGNOSTICS,
-- null_ls.methods.DIAGNOSTICS_ON_OPEN,
-- null_ls.methods.DIAGNOSTICS_ON_SAVE,
-- }
--
-- local linter_list_registered = function(filetype)
-- local registered_providers = list_registered_providers_names(filetype)
-- -- local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
-- -- return registered_providers[m] or {}
-- -- end, alternative_methods))
-- local providers_for_methods = vim.iter(vim.tbl_map(function(m)
-- return registered_providers[m] or {}
-- end, alternative_methods))
--
-- return providers_for_methods
-- end
-- -- end for lsp
--
-- local lsp_info = {
-- function()
-- local msg = "LS Inactive"
-- local buf_ft = vim.bo.filetype
-- -- start register
-- local buf_clients = vim.lsp.get_clients()
-- local buf_client_names = {}
-- if next(buf_clients) == nil then
-- -- TODO: clean up this if statement
-- if type(msg) == "boolean" or #msg == 0 then
-- return "LS Inactive"
-- end
-- return msg
-- end
-- -- add client
-- for _, client in pairs(buf_clients) do
-- if client.name ~= "null-ls" and client.name ~= "copilot" then
-- table.insert(buf_client_names, client.name)
-- end
-- end
-- -- add formatter
-- local supported_formatters = list_registered(buf_ft)
-- vim.list_extend(buf_client_names, supported_formatters)
-- -- add linter
-- local supported_linters = linter_list_registered(buf_ft)
-- vim.list_extend(buf_client_names, supported_linters)
-- -- decomple
-- local unique_client_names = vim.fn.uniq(buf_client_names)
-- local msg = table.concat(unique_client_names, ", ")
-- return msg
-- end,
-- --icon = " ",
-- icon = icons.ui.Gear .. "",
-- padding = 1,
-- }
--
-- local diagnostics = {
-- "diagnostics",
-- sources = { "nvim_diagnostic" },
-- sections = { "error", "warn" },
-- -- symbols = { error = " ", warn = " " },
-- symbols = {
-- error = icons.diagnostics.BoldError .. " ",
-- warn = icons.diagnostics.BoldWarning .. " ",
-- },
-- colored = true,
-- update_in_insert = false,
-- always_visible = false,
-- }
--
-- local diff = {
-- "diff",
-- colored = true,
-- -- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
-- symbols = {
-- added = icons.git.LineAdded .. " ",
-- modified = icons.git.LineModified .. " ",
-- removed = icons.git.LineRemoved .. " ",
-- }, -- changes diff symbols
-- cond = hide_in_width,
-- }
--
-- local spaces = function()
-- -- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
-- return icons.ui.Tab .. " " .. vim.api.nvim_get_option_value(0, "shiftwidth")
-- end
--
-- local mode = {
-- "mode",
-- padding = 1,
-- separator = { left = " " },
-- -- right_padding = 3,
-- fmt = function(str)
-- return icons.ui.Neovim .. " " .. str
-- end,
-- }
-- local branch = {
-- "branch",
-- padding = 1,
-- }
--
-- local get_branch = function()
-- if vim.b.gitsigns_head ~= nil then
-- return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6)
-- else
-- return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t")
-- end
-- end
--
-- local lsp_progress = {}
-- local data_ok, lspprogress = pcall(require, "lsp-progress")
-- if data_ok then
-- lsp_progress = lspprogress.progress
-- end
-- -- stylua: ignore
-- -- local github=vim.fn.fnamemodify("auto", ":t")
-- local github={}
-- local status_ok, _ = pcall(require, "github-theme")
-- if status_ok then
-- local C = require("github-theme.lib.color")
-- local config = require("github-theme.config").options
-- local s = require("github-theme.spec").load("github_dark_dimmed")
-- local p = s.palette
-- local tbg = config.transparent and "NONE" or s.bg0
--
-- local function blend(color, a)
-- return C(s.bg1):blend(C(color), a):to_css()
-- end
--
-- --- Create lualine group colors for github-theme
-- ---@param color string
-- local tint = function(color)
-- return {
-- a = { bg = color, fg = s.bg1 },
-- b = { bg = blend(color, 0.2), fg = blend(color, 0.8) },
-- c = { bg = "NONE", fg = blend(color, 0.60) },
-- }
-- end
--
-- local inactive_hi = { bg = tbg, fg = blend(s.fg1, 0.3) }
-- github = {
-- normal = tint(p.blue.base),
-- insert = tint(p.green.base),
-- command = tint(p.magenta.bright),
-- visual = tint(p.yellow.base),
-- replace = tint(p.red.base),
-- terminal = tint(p.orange),
-- inactive = {
-- a = inactive_hi,
-- b = inactive_hi,
-- c = inactive_hi,
-- },
-- }
-- end
--
-- require("lualine").setup({
-- options = {
-- theme = github or "auto",
-- -- theme = "auto",
-- component_separators = { left = "", right = "" },
-- section_separators = { left = "", right = "" },
-- disabled_filetypes = {
-- "TelescopePrompt",
-- "packer",
-- "alpha",
-- "dashboard",
-- "NvimTree",
-- "Outline",
-- "DressingInput",
-- "toggleterm",
-- "lazy",
-- "mason",
-- "neo-tree",
-- "startuptime",
-- },
-- always_divide_middle = true,
-- },
-- sections = {
-- lualine_a = {
-- mode,
-- },
-- lualine_b = { get_branch },
-- lualine_c = { lsp_info, diagnostics, lsp_progress },
-- lualine_x = { diff, spaces, "filetype" },
-- lualine_y = { "progress" },
-- lualine_z = {
-- { "location", separator = { right = " " }, padding = 1 },
-- },
-- },
-- inactive_sections = {
-- lualine_a = { "filename" },
-- lualine_b = {},
-- lualine_c = {},
-- lualine_x = {},
-- lualine_y = {},
-- lualine_z = { "location" },
-- },
-- tabline = {},
-- extensions = {},
-- })
-- end,
-- },
}

View file

@ -1,249 +0,0 @@
return {
-- {
-- "nvim-lualine/lualine.nvim",
-- event = "InsertEnter",
-- config = function()
-- local hide_in_width = function()
-- return vim.fn.winwidth(0) > 80
-- end
-- local icons = require("user.icons")
--
-- local getLeftSubstring = function(word, length)
-- if #word > length then
-- return string.sub(word, 1, length) .. "..."
-- else
-- return word
-- end
-- end
--
-- -- start for lsp
-- local list_registered_providers_names = function(filetype)
-- local s = require("null-ls.sources")
-- local available_sources = s.get_available(filetype)
-- local registered = {}
-- for _, source in ipairs(available_sources) do
-- for method in pairs(source.methods) do
-- registered[method] = registered[method] or {}
-- table.insert(registered[method], source.name)
-- end
-- end
-- return registered
-- end
--
-- local null_ls = require("null-ls")
-- -- for formatter
-- local list_registered = function(filetype)
-- local method = null_ls.methods.FORMATTING
-- local registered_providers = list_registered_providers_names(filetype)
-- return registered_providers[method] or {}
-- end
--
-- --- for linter
-- local alternative_methods = {
-- null_ls.methods.DIAGNOSTICS,
-- null_ls.methods.DIAGNOSTICS_ON_OPEN,
-- null_ls.methods.DIAGNOSTICS_ON_SAVE,
-- }
--
-- local linter_list_registered = function(filetype)
-- local registered_providers = list_registered_providers_names(filetype)
-- local providers_for_methods = vim.iter(vim.tbl_map(function(m)
-- return registered_providers[m] or {}
-- end, alternative_methods))
--
-- return providers_for_methods
-- end
-- -- end for lsp
--
-- local lsp_info = {
-- function()
-- local msg = "LS Inactive"
-- local buf_ft = vim.bo.filetype
-- -- start register
-- local buf_clients = {}
-- buf_clients = vim.lsp.get_clients({ bufnr = 0 })
-- local buf_client_names = {}
-- if next(buf_clients) == nil then
-- -- TODO: clean up this if statement
-- if type(msg) == "boolean" or #msg == 0 then
-- return "LS Inactive"
-- end
-- return msg
-- end
-- -- add client
-- for _, client in pairs(buf_clients) do
-- if client.name ~= "null-ls" and client.name ~= "copilot" then
-- table.insert(buf_client_names, client.name)
-- end
-- end
-- -- add formatter
-- local supported_formatters = list_registered(buf_ft)
-- vim.list_extend(buf_client_names, supported_formatters)
-- -- add linter
-- local supported_linters = linter_list_registered(buf_ft)
-- vim.list_extend(buf_client_names, supported_linters)
-- -- decomple
-- local unique_client_names = vim.fn.uniq(buf_client_names)
-- local msg = table.concat(unique_client_names, ", ")
-- return msg
-- end,
-- --icon = " ",
-- icon = icons.ui.Gear .. "",
-- padding = 1,
-- }
--
-- local diagnostics = {
-- "diagnostics",
-- sources = { "nvim_diagnostic" },
-- sections = { "error", "warn" },
-- -- symbols = { error = " ", warn = " " },
-- symbols = {
-- error = icons.diagnostics.BoldError .. " ",
-- warn = icons.diagnostics.BoldWarning .. " ",
-- },
-- colored = true,
-- update_in_insert = false,
-- always_visible = false,
-- }
--
-- local diff = {
-- "diff",
-- colored = true,
-- -- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
-- symbols = {
-- added = icons.git.LineAdded .. " ",
-- modified = icons.git.LineModified .. " ",
-- removed = icons.git.LineRemoved .. " ",
-- }, -- changes diff symbols
-- cond = hide_in_width,
-- }
--
-- local spaces = function()
-- -- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
-- return icons.ui.Tab .. " " .. vim.api.nvim_get_option_value(0, "shiftwidth")
-- end
--
-- local mode = {
-- "mode",
-- padding = 1,
-- separator = { left = " " },
-- -- right_padding = 3,
-- fmt = function(str)
-- return icons.ui.Neovim .. " " .. str
-- end,
-- }
-- local branch = {
-- "branch",
-- padding = 1,
-- }
--
-- local get_branch = function()
-- if vim.b.gitsigns_head ~= nil then
-- return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6)
-- else
-- return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t")
-- end
-- end
--
-- local lsp_progress = {}
-- local data_ok, lspprogress = pcall(require, "lsp-progress")
-- if data_ok then
-- lsp_progress = lspprogress.progress
-- end
-- -- stylua: ignore
-- -- local onedark=vim.fn.fnamemodify("auto", ":t")
-- local onedark={}
-- local is_transparat = true
-- local status_ok, onedarkpro = pcall(require, "onedarkpro.helpers")
-- if status_ok then
-- local colors = onedarkpro.get_colors("onedark")
--
-- onedark = {
-- normal = {
-- a = { bg = colors.green, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.green },
-- c = {
-- bg = is_transparat and colors.none or colors.bg_statusline,
-- fg = colors.fg,
-- },
-- },
--
-- insert = {
-- a = { bg = colors.blue, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.blue },
-- },
-- visual = {
-- a = { bg = colors.yellow, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.yellow },
-- },
-- replace = {
-- a = { bg = colors.red, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.red },
-- },
-- command = {
-- a = { bg = colors.purple, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.purple },
-- },
-- terminal = {
-- a = { bg = colors.cyan, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.cyan },
-- },
-- inactive = {
-- a = { bg = colors.bg, fg = colors.blue },
-- b = { bg = colors.bg, fg = colors.fg_gutter_inactive, gui = "bold" },
-- c = {
-- bg = is_transparat and colors.none or colors.bg,
-- fg = colors.fg_gutter_inactive,
-- },
-- },
-- }
-- end
--
-- require("lualine").setup({
-- options = {
-- theme = onedark,
-- -- theme = "auto",
-- component_separators = { left = "", right = "" },
-- section_separators = { left = "", right = "" },
-- disabled_filetypes = {
-- "TelescopePrompt",
-- "packer",
-- "alpha",
-- "dashboard",
-- "NvimTree",
-- "Outline",
-- "DressingInput",
-- "toggleterm",
-- "lazy",
-- "mason",
-- "neo-tree",
-- "startuptime",
-- },
-- always_divide_middle = true,
-- },
-- sections = {
-- lualine_a = {
-- mode,
-- },
-- lualine_b = { get_branch },
-- lualine_c = { lsp_info, diagnostics, lsp_progress },
-- lualine_x = { diff, spaces, "filetype" },
-- lualine_y = { "progress" },
-- lualine_z = {
-- { "location", separator = { right = " " }, padding = 1 },
-- },
-- },
-- inactive_sections = {
-- lualine_a = { "filename" },
-- lualine_b = {},
-- lualine_c = {},
-- lualine_x = {},
-- lualine_y = {},
-- lualine_z = { "location" },
-- },
-- tabline = {},
-- extensions = {},
-- })
-- end,
-- },
}

View file

@ -1,46 +0,0 @@
local is_neovide = false
if vim.g.neovide then
is_neovide = true
end
return {
-- animations
-- {
-- "echasnovski/mini.animate",
-- event = "BufRead",
-- enabled = not is_neovide,
-- opts = function()
-- -- don't use animate when scrolling with the mouse
-- local mouse_scrolled = false
-- for _, scroll in ipairs({ "Up", "Down" }) do
-- local key = "<ScrollWheel" .. scroll .. ">"
-- vim.keymap.set({ "", "i" }, key, function()
-- mouse_scrolled = true
-- return key
-- end, { expr = true })
-- end
--
-- local animate = require("mini.animate")
-- return {
-- resize = {
-- timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
-- },
-- scroll = {
-- timing = animate.gen_timing.linear({ duration = 150, unit = "total" }),
-- subscroll = animate.gen_subscroll.equal({
-- predicate = function(total_scroll)
-- if mouse_scrolled then
-- mouse_scrolled = false
-- return false
-- end
-- return total_scroll > 1
-- end,
-- }),
-- },
-- }
-- end,
-- config = function(_, opts)
-- require("mini.animate").setup(opts)
-- end,
-- },
}

View file

@ -1,51 +0,0 @@
return {
-- "echasnovski/mini.map",
-- branch = "stable",
-- event = "BufRead",
-- config = function()
-- require("mini.map").setup()
-- local map = require("mini.map")
-- map.setup({
-- integrations = {
-- map.gen_integration.builtin_search(),
-- map.gen_integration.diagnostic({
-- error = "DiagnosticFloatingError",
-- warn = "DiagnosticFloatingWarn",
-- info = "DiagnosticFloatingInfo",
-- hint = "DiagnosticFloatingHint",
-- }),
-- },
-- symbols = {
-- encode = map.gen_encode_symbols.dot("4x2"),
-- },
-- window = {
-- side = "right",
-- width = 10, -- set to 1 for a pure scrollbar :)
-- winblend = 15,
-- show_integration_count = false,
-- },
-- })
--
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = "*",
-- callback = function()
-- local exclude_ft = {
-- "qf",
-- "NvimTree",
-- "toggleterm",
-- "TelescopePrompt",
-- "alpha",
-- "netrw",
-- }
--
-- local map = require("mini.map")
-- if vim.tbl_contains(exclude_ft, vim.o.filetype) then
-- vim.b.minimap_disable = true
-- map.close()
-- elseif vim.o.buftype == "" then
-- map.open()
-- end
-- end,
-- })
-- end,
}

View file

@ -1,76 +0,0 @@
return {
-- { "kyazdani42/nvim-tree.lua", enabled = false },
-- {
-- "nvim-neo-tree/neo-tree.nvim",
-- dependencies = { "MunifTanjim/nui.nvim" },
-- event = "BufWinEnter",
-- cmd = "Neotree",
-- keys = {
-- {
-- "<leader>fE",
-- function()
-- require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
-- end,
-- desc = "Explorer NeoTree (cwd)",
-- },
-- { "<leader>n", "<cmd>Neotree toggle<cr>", desc = "Explorer NeoTree (root dir)", remap = true },
-- { "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
-- },
-- deactivate = function()
-- vim.cmd([[Neotree close]])
-- end,
-- init = function()
-- vim.g.neo_tree_remove_legacy_commands = 1
-- if vim.fn.argc() == 1 then
-- local stat = vim.loop.fs_stat(vim.fn.argv(0))
-- if stat and stat.type == "directory" then
-- require("neo-tree")
-- end
-- end
-- end,
-- opts = {
-- filesystem = {
-- bind_to_cwd = false,
-- follow_current_file = true,
-- },
-- window = {
-- position = "left",
-- width = 30,
-- mappings = {
-- ["<space>"] = "none",
-- },
-- },
-- default_component_configs = {
-- icon = {
-- folder_closed = "",
-- folder_open = "",
-- folder_empty = "ﰊ",
-- -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- -- then these will never be used.
-- default = "*",
-- highlight = "NeoTreeFileIcon",
-- },
-- modified = {
-- symbol = "[+]",
-- highlight = "NeoTreeModified",
-- },
-- git_status = {
-- symbols = {
-- -- Change type
-- added = "✚", -- or "✚", but this is redundant info if you use git_status_colors on the name
-- modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
-- deleted = "✖", -- this can only be used in the git_status source
-- renamed = "", -- this can only be used in the git_status source
-- -- Status type
-- untracked = "",
-- ignored = "",
-- -- unstaged = "",
-- unstaged = "",
-- staged = "",
-- conflict = "",
-- },
-- },
-- },
-- },
-- },
}

View file

@ -1,255 +0,0 @@
-- local icons = vim.g.pcode_icons
-- local HEIGHT_RATIO = 0.9 -- You can change this
-- local WIDTH_RATIO = 0.5 -- You can change this too
return {
-- "kyazdani42/nvim-tree.lua",
-- lazy = true,
-- cmd = { "NvimTreeFindFileToggle", "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" },
-- opts = {
-- auto_reload_on_write = false,
-- disable_netrw = false,
-- hijack_cursor = false,
-- hijack_netrw = true,
-- hijack_unnamed_buffer_when_opening = false,
-- sort_by = "name",
-- root_dirs = {},
-- prefer_startup_root = false,
-- sync_root_with_cwd = true,
-- reload_on_bufenter = false,
-- respect_buf_cwd = false,
-- on_attach = "default",
-- select_prompts = false,
-- view = {
-- adaptive_size = false,
-- centralize_selection = true,
-- -- width = 30,
-- side = "left",
-- preserve_window_proportions = false,
-- number = false,
-- relativenumber = false,
-- signcolumn = "yes",
-- -- float = {
-- -- enable = false,
-- -- quit_on_focus_loss = true,
-- -- open_win_config = {
-- -- relative = "editor",
-- -- border = "rounded",
-- -- width = 30,
-- -- height = 30,
-- -- row = 1,
-- -- col = 1,
-- -- },
-- -- },
-- float = {
-- enable = true,
-- open_win_config = function()
-- local screen_w = vim.opt.columns:get()
-- local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
-- local window_w = screen_w * WIDTH_RATIO
-- local window_h = screen_h * HEIGHT_RATIO
-- local window_w_int = math.floor(window_w)
-- local window_h_int = math.floor(window_h)
-- local center_x = (screen_w - window_w) / 2
-- local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get()
-- return {
-- border = "rounded",
-- relative = "editor",
-- row = center_y,
-- col = center_x,
-- width = window_w_int,
-- height = window_h_int,
-- }
-- end,
-- },
-- width = function()
-- return math.floor(vim.opt.columns:get() * WIDTH_RATIO)
-- end,
-- },
-- renderer = {
-- add_trailing = false,
-- group_empty = false,
-- highlight_git = true,
-- full_name = false,
-- highlight_opened_files = "none",
-- -- root_folder_label = ":t",
-- root_folder_label = false,
-- indent_width = 2,
-- indent_markers = {
-- enable = true,
-- inline_arrows = true,
-- icons = {
-- corner = "└",
-- edge = "│",
-- item = "│",
-- none = " ",
-- },
-- },
-- icons = {
-- webdev_colors = true,
-- git_placement = "before",
-- padding = " ",
-- symlink_arrow = " ➛ ",
-- show = {
-- file = true,
-- folder = true,
-- folder_arrow = true,
-- git = true,
-- },
-- glyphs = {
-- default = icons.ui.Text,
-- symlink = icons.ui.FileSymlink,
-- bookmark = icons.ui.BookMark,
-- folder = {
-- -- arrow_closed = icons.ui.TriangleShortArrowRight,
-- arrow_closed = icons.ui.ChevronShortRight,
-- -- arrow_open = icons.ui.TriangleShortArrowDown,
-- arrow_open = icons.ui.ChevronShortDown,
-- default = icons.ui.Folder,
-- open = icons.ui.FolderOpen,
-- empty = icons.ui.EmptyFolder,
-- empty_open = icons.ui.EmptyFolderOpen,
-- symlink = icons.ui.FolderSymlink,
-- symlink_open = icons.ui.FolderOpen,
-- },
-- git = {
-- unstaged = icons.git.FileUnstaged,
-- staged = icons.git.FileStaged,
-- unmerged = icons.git.FileUnmerged,
-- renamed = icons.git.FileRenamed,
-- untracked = icons.git.FileUntracked,
-- deleted = icons.git.FileDeleted,
-- ignored = icons.git.FileIgnored,
-- },
-- },
-- },
-- special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
-- symlink_destination = true,
-- },
-- hijack_directories = {
-- enable = false,
-- auto_open = true,
-- },
-- update_focused_file = {
-- enable = true,
-- debounce_delay = 15,
-- update_root = true,
-- ignore_list = {},
-- },
-- diagnostics = {
-- enable = true,
-- show_on_dirs = false,
-- show_on_open_dirs = true,
-- debounce_delay = 50,
-- severity = {
-- min = vim.diagnostic.severity.HINT,
-- max = vim.diagnostic.severity.ERROR,
-- },
-- icons = {
-- hint = icons.diagnostics.BoldHint,
-- info = icons.diagnostics.BoldInformation,
-- warning = icons.diagnostics.BoldWarning,
-- error = icons.diagnostics.BoldError,
-- },
-- },
-- filters = {
-- dotfiles = false,
-- git_clean = false,
-- no_buffer = false,
-- custom = { "node_modules", "\\.cache", "\\.git" },
-- exclude = {
-- ".gitignore",
-- ".prettierignore",
-- },
-- },
-- filesystem_watchers = {
-- enable = true,
-- debounce_delay = 50,
-- ignore_dirs = {},
-- },
-- git = {
-- enable = true,
-- ignore = false,
-- show_on_dirs = true,
-- show_on_open_dirs = true,
-- disable_for_dirs = {},
-- timeout = 400,
-- },
-- actions = {
-- use_system_clipboard = true,
-- change_dir = {
-- enable = true,
-- global = false,
-- restrict_above_cwd = false,
-- },
-- expand_all = {
-- max_folder_discovery = 300,
-- exclude = {},
-- },
-- file_popup = {
-- open_win_config = {
-- col = 1,
-- row = 1,
-- relative = "cursor",
-- border = "shadow",
-- style = "minimal",
-- },
-- },
-- open_file = {
-- quit_on_open = false,
-- resize_window = false,
-- window_picker = {
-- enable = true,
-- picker = "default",
-- chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
-- exclude = {
-- filetype = { "notify", "lazy", "qf", "diff", "fugitive", "fugitiveblame" },
-- buftype = { "nofile", "terminal", "help" },
-- },
-- },
-- },
-- remove_file = {
-- close_window = true,
-- },
-- },
-- trash = {
-- cmd = "trash",
-- require_confirm = true,
-- },
-- live_filter = {
-- prefix = "[FILTER]: ",
-- always_show_folders = true,
-- },
-- tab = {
-- sync = {
-- open = false,
-- close = false,
-- ignore = {},
-- },
-- },
-- notify = {
-- threshold = vim.log.levels.INFO,
-- -- threshold = vim.log.levels.ERROR,
-- },
-- log = {
-- enable = false,
-- truncate = false,
-- types = {
-- all = false,
-- config = false,
-- copy_paste = false,
-- dev = false,
-- diagnostics = false,
-- git = false,
-- profile = false,
-- watcher = false,
-- },
-- },
-- system_open = {
-- cmd = nil,
-- args = {},
-- },
-- },
-- config = function(_, opts)
-- require("nvim-tree").setup(opts)
-- end,
}

View file

@ -1,335 +0,0 @@
function TABLE_CONTAINS(tbl, x)
local found = false
for _, v in pairs(tbl) do
if v == x then
found = true
end
end
return found
end
local icons = vim.g.pcode_icons.folding
return {
-- "kevinhwang91/nvim-ufo",
-- dependencies = {
-- "kevinhwang91/promise-async",
-- {
-- "luukvbaal/statuscol.nvim",
-- config = function()
-- local builtin = require "statuscol.builtin"
-- require("statuscol").setup {
-- -- relculright = true,
-- -- segments = {
-- -- { text = { builtin.foldfunc }, click = "v:lua.ScFa" },
-- -- { text = { "%s" }, click = "v:lua.ScSa" },
-- -- { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
-- -- },
-- setopt = true,
-- relculright = true,
-- segments = {
-- { text = { "%s" }, click = "v:lua.ScSa" },
-- {
-- -- text = { builtin.foldfunc, " " },
-- text = { builtin.foldfunc },
-- condition = { builtin.not_empty, true, builtin.not_empty },
-- click = "v:lua.ScFa",
-- },
-- { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
-- -- { text = { builtin.lnumfunc }, click = "v:lua.ScLa" },
-- },
-- }
-- end,
-- },
-- },
-- enabled = true,
-- lazy = true,
-- -- event = "BufReadPost",
-- -- event = { "BufReadPost", "BufRead", "InsertEnter", "BufNewFile" },
-- event = "VeryLazy",
-- config = function()
-- vim.o.foldcolumn = "1" -- '0' is not bad
-- vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
-- vim.o.foldlevelstart = 99
-- vim.o.foldenable = true
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep:│,foldclose:]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep:│,foldclose:]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:󰛲,foldsep:│,foldclose:󰜄]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep:│,foldclose:]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:▾,foldsep:│,foldclose:▸]]
-- vim.opt.fillchars = {
-- vert = icons.vert,
-- fold = icons.fold,
-- eob = icons.eob,
-- diff = icons.diff,
-- msgsep = icons.msgsep,
-- foldopen = icons.foldopen,
-- foldsep = icons.foldsep,
-- foldclose = icons.foldclose,
-- }
-- -- these are "extra", change them as you like
-- vim.keymap.set("n", "zR", require("ufo").openAllFolds)
-- vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
-- vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID "Comment"), "fg"))
-- -- vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("IblIndent")), "fg"))
-- -- Option 3: treesitter as a main provider instead
-- -- Only depend on `nvim-treesitter/queries/filetype/folds.scm`,
-- -- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`
--
-- --[[require("ufo").setup({
-- -- provider_selector = function(bufnr, filetype, buftype)
-- -- return { "treesitter", "indent" }
-- -- end,
-- open_fold_hl_timeout = 150,
-- close_fold_kinds_for_ft = {
-- default = { "imports", "comment" },
-- json = { "array" },
-- c = { "comment", "region" },
-- },
-- preview = {
-- win_config = {
-- border = { "", "─", "", "", "", "─", "", "" },
-- -- winhighlight = 'Normal:Normal',
-- -- winhighlight = 'IncSearch:Folded',
-- winhighlight = "Normal:UfoPreviewNormal,FloatBorder:UfoPreviewBorder,CursorLine:UfoPreviewCursorLine",
-- winblend = 0,
-- },
-- mappings = {
-- scrollU = "<C-u>",
-- scrollD = "<C-d>",
-- jumpTop = "[",
-- jumpBot = "]",
-- },
-- },
-- provider_selector = function(_, filetype)
-- return { "treesitter", "indent" }
-- end,
-- fold_virt_text_handler = function(virt_text, lnum, end_lnum, width, truncate)
-- local result = {}
-- local _end = end_lnum - 1
-- local final_text = vim.trim(vim.api.nvim_buf_get_text(0, _end, 0, _end, -1, {})[1])
-- local suffix = final_text:format(end_lnum - lnum)
-- local suffix_width = vim.fn.strdisplaywidth(suffix)
-- local target_width = width - suffix_width
-- local cur_width = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunk_text = chunk[1]
-- local chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- if target_width > cur_width + chunk_width then
-- table.insert(result, chunk)
-- else
-- chunk_text = truncate(chunk_text, target_width - cur_width)
-- local hl_group = chunk[2]
-- table.insert(result, { chunk_text, hl_group })
-- chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- -- str width returned from truncate() may less than 2nd argument, need padding
-- if cur_width + chunk_width < target_width then
-- suffix = suffix .. (" "):rep(target_width - cur_width - chunk_width)
-- end
-- break
-- end
-- cur_width = cur_width + chunk_width
-- end
-- table.insert(result, { " ⋯ ", "NonText" })
-- if vim.bo.filetype ~= "json" then
-- table.insert(result, { suffix, "TSPunctBracket" })
-- end
-- return result
-- end,
-- })]]
-- --
--
-- -- start ini bagian code support comment dan import
-- local ftMap = {
-- vim = "indent",
-- python = { "indent" },
-- git = "",
-- -- javascriptreact = { "treesitter", "indent" },
-- -- typescriptreact = { "treesitter", "indent" },
-- }
--
-- local function customizeSelector(bufnr)
-- local function handleFallbackException(err, providerName)
-- if type(err) == "string" and err:match "UfoFallbackException" then
-- return require("ufo").getFolds(bufnr, providerName)
-- else
-- return require("promise").reject(err)
-- end
-- end
--
-- return require("ufo")
-- .getFolds(bufnr, "lsp")
-- :catch(function(err)
-- return handleFallbackException(err, "treesitter")
-- end)
-- :catch(function(err)
-- return handleFallbackException(err, "indent")
-- end)
-- end
--
-- require("ufo").setup {
-- open_fold_hl_timeout = 150,
-- close_fold_kinds_for_ft = {
-- -- default = { "imports", "comment" },
-- -- json = { "array" },
-- -- c = { "comment", "region" },
-- },
-- preview = {
-- win_config = {
-- border = { "", "─", "", "", "", "─", "", "" },
-- winhighlight = "Normal:Folded",
-- winblend = 0,
-- },
-- mappings = {
-- scrollU = "<C-u>",
-- scrollD = "<C-d>",
-- jumpTop = "[",
-- jumpBot = "]",
-- },
-- },
-- provider_selector = function(bufnr, filetype, buftype)
-- -- if you prefer treesitter provider rather than lsp,
-- -- return ftMap[filetype]
-- -- return ftMap[filetype] or {'treesitter', 'indent'}
-- return ftMap[filetype] or customizeSelector
--
-- -- refer to ./doc/example.lua for detail
-- end,
--
-- fold_virt_text_handler = function(virt_text, lnum, end_lnum, width, truncate)
-- local result = {}
-- local closed_fold_text = "comments ..." -- Teks yang ingin ditampilkan
-- local import_fold_text = "import ..." -- Teks yang ingin ditampilkan
-- local is_comment = false -- Variabel untuk mengecek apakah ini komentar
-- local is_import = false
-- local is_bracket = false
--
-- -- Memeriksa apakah baris awal dari fold adalah komentar
-- local start_line = vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1]
-- -- cari comentar dengan awalan /* untuk generaal comment
-- if start_line:find "^%s*%/%*" then
-- is_comment = true
-- -- cara commentar dengan awalan <!-- untuk html
-- elseif start_line:find "^%s*<!--" then
-- is_comment = true
-- -- cari comentar dengan awalan -- untuk lua
-- elseif start_line:find "^%s*%-%-" then
-- is_comment = true
-- end
-- -- cek fold yang berawalan import
-- if start_line:find "^%s*import" then
-- is_import = true
-- end
-- -- cek fold dengan akhiran {
-- if start_line:find "%s*{%s*$" then
-- is_bracket = true
-- end
-- if is_comment then
-- local suffix = string.format(" %s ", closed_fold_text)
-- local target_width = width - vim.fn.strdisplaywidth(suffix)
-- local cur_width = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunk_text = chunk[1]
-- local chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- if target_width > cur_width + chunk_width then
-- table.insert(result, chunk)
-- else
-- chunk_text = truncate(chunk_text, target_width - cur_width)
-- local hl_group = chunk[2]
-- table.insert(result, { chunk_text, hl_group })
-- break
-- end
-- cur_width = cur_width + chunk_width
-- end
-- -- Menambahkan teks 'Comments ...' ke akhir baris yang dilipat
-- table.insert(result, { suffix, "NonText" })
-- elseif is_import then
-- --[[
-- local suffix = string.format(" %s ", import_fold_text)
-- local target_width = width - vim.fn.strdisplaywidth(suffix)
-- local cur_width = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunk_text = chunk[1]
-- local chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- if target_width > cur_width + chunk_width then
-- table.insert(result, chunk)
-- else
-- chunk_text = truncate(chunk_text, target_width - cur_width)
-- local hl_group = chunk[2]
-- table.insert(result, { chunk_text, hl_group })
-- break
-- end
-- cur_width = cur_width + chunk_width
-- end
-- -- Menambahkan teks 'Comments ...' ke akhir baris yang dilipat
-- table.insert(result, { suffix, "NonText" })
-- ]]
-- --
--
-- local suffix = (" 󰁂 %d "):format(end_lnum - lnum)
-- local sufWidth = vim.fn.strdisplaywidth(suffix)
-- local targetWidth = width - sufWidth
-- local curWidth = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunkText = chunk[1]
-- local chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- if targetWidth > curWidth + chunkWidth then
-- table.insert(result, chunk)
-- else
-- chunkText = truncate(chunkText, targetWidth - curWidth)
-- local hlGroup = chunk[2]
-- table.insert(result, { chunkText, hlGroup })
-- chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- -- str width returned from truncate() may less than 2nd argument, need padding
-- if curWidth + chunkWidth < targetWidth then
-- suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
-- end
-- break
-- end
-- curWidth = curWidth + chunkWidth
-- end
-- table.insert(result, { " import⋯ ", "NonText" })
-- table.insert(result, { suffix, "MoreMsg" })
-- else
-- -- Jika bukan komentar, tampilkan teks asli
-- -- for _, chunk in ipairs(virt_text) do
-- -- table.insert(result, chunk)
-- -- end
-- local _end = end_lnum - 1
-- local final_text = vim.trim(vim.api.nvim_buf_get_text(0, _end, 0, _end, -1, {})[1])
-- local suffix = final_text:format(end_lnum - lnum)
-- local suffix_width = vim.fn.strdisplaywidth(suffix)
-- local target_width = width - suffix_width
-- local cur_width = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunk_text = chunk[1]
-- local chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- if target_width > cur_width + chunk_width then
-- table.insert(result, chunk)
-- else
-- chunk_text = truncate(chunk_text, target_width - cur_width)
-- local hl_group = chunk[2]
-- table.insert(result, { chunk_text, hl_group })
-- chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- -- str width returned from truncate() may less than 2nd argument, need padding
-- if cur_width + chunk_width < target_width then
-- suffix = suffix .. (" "):rep(target_width - cur_width - chunk_width)
-- end
-- break
-- end
-- cur_width = cur_width + chunk_width
-- end
-- table.insert(result, { " ⋯ ", "NonText" })
-- local l = { "javascriptreact", "typescriptreact" }
-- if TABLE_CONTAINS(l, vim.bo.filetype) and not is_bracket then
-- table.insert(result, { suffix, "TSPunctBracket" })
-- end
-- end
-- return result
-- end,
-- }
-- -- end bagian code support comment dan import
-- end,
}

View file

@ -1,114 +0,0 @@
return {
-- { "navarasu/onedark.nvim", enabled = false },
-- {
-- "olimorris/onedarkpro.nvim",
-- priority = 1000, -- Ensure it loads first
-- config = function()
-- local is_transparent = false
-- require("onedarkpro").setup({
-- styles = {
-- types = "NONE",
-- methods = "NONE",
-- numbers = "NONE",
-- strings = "NONE",
-- comments = "italic",
-- keywords = "bold,italic",
-- constants = "NONE",
-- functions = "italic",
-- operators = "NONE",
-- variables = "NONE",
-- parameters = "NONE",
-- conditionals = "italic",
-- virtual_text = "NONE",
-- tags = "italic",
-- },
-- colors = {
-- onedark = {
-- green = "#99c379",
-- gray = "#8094b4",
-- red = "#e06c75",
-- purple = "#c678dd",
-- yellow = "#e5c07a",
-- blue = "#61afef",
-- cyan = "#56b6c2",
-- bg_statusline = "#282c34",
-- indentline = "#3b4261",
-- float_bg = "#282c34",
-- },
-- },
-- options = {
-- cursorline = true,
-- transparency = is_transparent,
-- terminal_colors = true,
-- },
-- highlights = {
-- -- overide cursor line fill colors
-- LineNr = { fg = "#49505E" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
-- CursorLineNr = { fg = "${blue}" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
-- CursorLine = { bg = "#333842" },
-- Cursor = { fg = "${bg}", bg = "${fg}" }, -- character under the cursor
-- lCursor = { fg = "${bg}", bg = "${fg}" }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
-- CursorIM = { fg = "${bg}", bg = "${fg}" }, -- like Cursor, but used when in IME mode |CursorIM|
-- CursorColumn = { bg = "#333842" }, -- Screen-column at the cursor, when 'cursorcolumn' is set.
-- -- overide nvimtree folder icon fill color
-- NvimTreeFolderIcon = { fg = "${gray}" },
-- -- overide nvimtree text fill color folder opened
-- NvimTreeOpenedFolderName = { fg = "${blue}" },
-- -- overide nvimtree text fill color root folder
-- NvimTreeRootFolder = { fg = "${yellow}" },
-- NvimTreeSpecialFile = { fg = "${orange}" },
-- NvimTreeWinSeparator = { fg = "#202329" },
-- NvimTreeIndentMarker = { fg = "#3E4450" },
-- -- overide indenline fill color
-- IblIndent = { fg = "#3E4450" },
-- -- overide cmp cursorline fill color with #333842
-- PmenuSel = { bg = "#333842" },
-- illuminatedWord = { bg = "#3b4261" },
-- illuminatedCurWord = { bg = "#3b4261" },
-- IlluminatedWordText = { bg = "#3b4261" },
-- IlluminatedWordRead = { bg = "#3b4261" },
-- IlluminatedWordWrite = { bg = "#3b4261" },
-- StatusLine = { fg = "#f8f8f2", bg = is_transparent and "NONE" or "${bg}" },
-- StatusLineTerm = { fg = "#f8f8f2", bg = "${bg}" },
-- BufferLineFill = { bg = is_transparent and "NONE" or "${bg}" },
-- ["@string.special.url.html"] = { fg = "${green}" },
-- ["@lsp.type.parameter"] = { fg = "${gray}" },
-- -- ["@text.uri.html"] = { fg = "${green}" },
-- -- ["@tag.javascript"] = { fg = "${red}" },
-- -- ["@tag.attribute"] = { fg = "${orange}", style = "italic" },
-- -- ["@constructor.javascript"] = { fg = "${red}" },
-- -- ["@variable"] = { fg = "${fg}", style = "NONE" }, -- various variable names
-- -- ["@variable.builtin"] = { fg = "${red}", style = "NONE" },
-- -- ["@variable.member"] = "${cyan}",
-- -- ["@variable.parameter"] = "${red}",
-- -- ["@property"] = { fg = "${cyan}" }, -- similar to `@field`
-- ["@property.lua"] = { fg = "${red}", bg = "NONE" },
-- ["@lsp.type.property.lua"] = { fg = "${cyan}", bg = "NONE" },
-- ["@lsp.type.variable.lua"] = { fg = "${red}", bg = "NONE" },
-- NvimTreeGitDirty = { fg = "${yellow}" },
-- Pmenu = { fg = "${fg}", bg = "${bg}" },
-- PmenuThumb = { bg = "${gray}" }, -- Popup menu: Thumb of the scrollbar.
-- -- overide lualine fill color with bg color
-- LualineNormal = { bg = "${bg}" },
-- -- overide lualine_c fill color with bg color
-- LualineC = { bg = "${bg}" },
-- -- overide lualine_x fill color with bg color
-- LualineX = { bg = "${bg}" },
-- -- overide which-key fill color with bg color
-- -- WhichKey = { bg = "${bg}" },
-- -- -- overide which-key fill color with bg color
-- -- WhichKeySeperator = { bg = "${bg}" },
-- -- -- overide which-key fill color with bg color
-- -- WhichKeyDesc = { fg = "${red}" },
-- -- -- overide which-key fill color with bg color
-- -- WhichKeyFloat = { bg = "${bg}" },
-- WhichKeyFloat = { bg = is_transparent and "NONE" or "${bg}" },
-- -- -- overide which-key fill color with bg color
-- -- WhichKeyValue = { bg = "${bg}" },
-- -- -- overide which-key fill color with bg color
-- -- WhichKeyBorder = { bg = "${bg}" },
-- },
-- })
-- end,
-- },
}

View file

@ -1,27 +0,0 @@
return {
"folke/playground",
lazy = true,
event = "BufRead",
config = function()
require("nvim-treesitter.configs").setup {
playground = {
enable = true,
disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false, -- Whether the query persists across vim sessions
keybindings = {
toggle_query_editor = "o",
toggle_hl_groups = "i",
toggle_injected_languages = "t",
toggle_anonymous_nodes = "a",
toggle_language_display = "I",
focus_language = "f",
unfocus_language = "F",
update = "R",
goto_node = "<cr>",
show_help = "?",
},
},
}
end,
}

View file

@ -1,40 +0,0 @@
return {
-- Incremental rename
-- {
-- "smjonas/inc-rename.nvim",
-- cmd = "IncRename",
-- keys = {
-- {
-- "<leader>un",
-- function()
-- return ":IncRename " .. vim.fn.expand "<cword>"
-- end,
-- desc = "Incremental rename",
-- mode = "n",
-- noremap = true,
-- expr = true,
-- },
-- },
-- config = true,
-- },
--
-- -- Refactoring tool
-- {
-- "ThePrimeagen/refactoring.nvim",
-- keys = {
-- {
-- "<leader>r",
-- function()
-- require("refactoring").select_refactor {
-- show_success_message = true,
-- }
-- end,
-- mode = "v",
-- noremap = true,
-- silent = true,
-- expr = false,
-- },
-- },
-- opts = {},
-- },
}

View file

@ -1,80 +0,0 @@
return {
-- {
-- "folke/tokyonight.nvim",
-- lazy = false,
-- priority = 1000,
-- opts = {},
-- config = function()
-- local status_ok, tokyonight = pcall(require, "tokyonight")
-- if not status_ok then
-- return
-- end
-- local transp = false
-- local sidebar = "normal" --"dark , transparent, normal"
-- local hilight = "#292e42"
-- local data_exists, config = pcall(require, "core.config")
-- if data_exists then
-- local tras = config.transparent_mode
-- if tras == 1 then
-- transp = true
-- sidebar = "transparent"
-- -- hilight = "#3E4254"
-- -- hilight = "#353a56"
-- hilight = "#292e42"
-- end
-- end
-- tokyonight.setup({
-- -- your configuration comes here
-- -- or leave it empty to use the default settings
-- style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
-- light_style = "day", -- The theme is used when the background is set to light
-- transparent = transp, -- Enable this to disable setting the background color
-- terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
-- styles = {
-- -- Style to be applied to different syntax groups
-- -- Value is any valid attr-list value for `:help nvim_set_hl`
-- -- comments = { italic = true },
-- comments = { italic = true },
-- keywords = { italic = true },
-- functions = {},
-- variables = {},
-- -- Background styles. Can be "dark", "transparent" or "normal"
-- sidebars = sidebar, -- style for sidebars, see below
-- floats = sidebar, -- style for floating windows
-- },
-- sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
-- day_brightness = 0.2, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
-- hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
-- dim_inactive = false, -- dims inactive windows
-- lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
--
-- --- You can override specific color groups to use other groups or a hex color
-- --- function will be called with a ColorScheme table
-- -- @param colors ColorScheme
-- on_colors = function(colors)
-- colors.bg_highlight = hilight
-- colors.bg_statusline = colors.none
-- end,
--
-- --- You can override specific highlights to use other groups or a hex color
-- --- function will be called with a Highlights and ColorScheme table
-- --@param highlights Highlights
-- -- @param colors ColorScheme
-- on_highlights = function(highlights, colors)
-- highlights.NvimTreeFolderIcon = {
-- bg = colors.none,
-- fg = "#e0af68",
-- }
-- highlights.Underlined = {
-- underline = false,
-- }
-- highlights.NvimTreeWinSeparator = {
-- fg = colors.border,
-- }
-- highlights.BufferLineFill = { bg = colors.bg }
-- highlights.NvimTreeSpecialFile = { fg = colors.purple, underline = false }
-- end,
-- })
-- end,
-- },
}

View file

@ -1,72 +0,0 @@
return {
-- {
-- "folke/tokyonight.nvim",
-- lazy = false,
-- priority = 1000,
-- opts = {},
-- config = function()
-- local status_ok, tokyonight = pcall(require, "tokyonight")
-- if not status_ok then
-- return
-- end
-- local transp = false
-- local sidebar = "normal" --"dark , transparent, normal"
-- tokyonight.setup({
-- -- your configuration comes here
-- -- or leave it empty to use the default settings
-- style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
-- light_style = "day", -- The theme is used when the background is set to light
-- transparent = transp, -- Enable this to disable setting the background color
-- terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
-- styles = {
-- -- Style to be applied to different syntax groups
-- -- Value is any valid attr-list value for `:help nvim_set_hl`
-- -- comments = { italic = true },
-- comments = { italic = true },
-- keywords = { italic = true },
-- functions = {},
-- variables = {},
-- -- Background styles. Can be "dark", "transparent" or "normal"
-- sidebars = sidebar, -- style for sidebars, see below
-- floats = sidebar, -- style for floating windows
-- },
-- sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
-- day_brightness = 0.2, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
-- hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
-- dim_inactive = false, -- dims inactive windows
-- lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
--
-- --- You can override specific color groups to use other groups or a hex color
-- --- function will be called with a ColorScheme table
-- -- @param colors ColorScheme
-- on_colors = function(colors)
-- colors.bg_statusline = colors.bg
-- colors.bg_sidebar = colors.bg
-- colors.bg = colors.bg
-- colors.bg_dark = colors.bg
-- colors.terminal_black = colors.bg
-- end,
--
-- --- You can override specific highlights to use other groups or a hex color
-- --- function will be called with a Highlights and ColorScheme table
-- --@param highlights Highlights
-- -- @param colors ColorScheme
-- on_highlights = function(highlights, colors)
-- highlights.NvimTreeFolderIcon = {
-- bg = colors.none,
-- fg = "#e0af68",
-- }
-- highlights.Underlined = {
-- underline = false,
-- }
-- highlights.BufferLineFill = { bg = colors.none }
-- highlights.NvimTreeWinSeparator = {
-- fg = colors.border,
-- bg = colors.bg_sidebar,
-- }
-- highlights.Pmenu = { fg = colors.fg, bg = colors.bg }
-- end,
-- })
-- end,
-- },
}

View file

@ -1,10 +0,0 @@
return {
-- "pmizio/typescript-tools.nvim",
-- event = "BufRead",
-- dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
-- config = function()
-- require("typescript-tools").setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- })
-- end,
}

View file

@ -1,26 +0,0 @@
return {
-- { "RRethy/nvim-base16" },
-- -- simbol outline
-- {
-- "simrat39/symbols-outline.nvim",
-- lazy = true,
-- event = "BufRead",
-- config = function()
-- require("symbols-outline").setup()
-- end,
-- },
-- {
-- "nvim-lualine/lualine.nvim",
-- lazy = true,
-- event = "BufWinEnter",
-- config = function()
-- require("user.lualine")
-- end,
-- },
-- { "RRethy/vim-illuminate", event = "InsertEnter", enabled = true },
-- { "cpea2506/one_monokai.nvim" },
-- { "luisiacc/gruvbox-baby", lazy = true, enabled = false },
-- { "projekt0n/github-nvim-theme", version = "v0.0.7" },
-- { "stevearc/dressing.nvim", enabled = false },
-- { "karb94/neoscroll.nvim", enabled = false },
}

53
lua/gemini/init.lua Normal file
View file

@ -0,0 +1,53 @@
local M = {}
M.last_popup_win = nil
M.last_popup_buf = nil
function M.ask_gemini()
-- Ambil path file buffer aktif
--[[ local buf_path = vim.api.nvim_buf_get_name(0)
if buf_path ~= "" then
local dir = vim.fn.fnamemodify(buf_path, ":h")
vim.api.nvim_set_current_dir(dir)
end ]]
vim.ui.input({ prompt = "Prompt ke Gemini: " }, function(prompt)
if not prompt or prompt == "" then
vim.notify("Prompt kosong", vim.log.levels.WARN)
return
end
M.show_popup("Loading...")
vim.schedule(function()
local output = vim.fn.system('gemini --prompt "' .. prompt .. '"')
M.show_popup(output)
end)
end)
end
function M.show_popup(output)
if M.last_popup_win and vim.api.nvim_win_is_valid(M.last_popup_win) then
vim.api.nvim_win_close(M.last_popup_win, true)
end
if M.last_popup_buf and vim.api.nvim_buf_is_valid(M.last_popup_buf) then
vim.api.nvim_buf_delete(M.last_popup_buf, { force = true })
end
local buf = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_lines(buf, 0, -1, false, vim.split(output or "", "\n"))
local width = math.floor(vim.o.columns * 0.6)
local height = math.floor(vim.o.lines * 0.8)
local win = vim.api.nvim_open_win(buf, true, {
relative = "editor",
width = width,
height = height,
row = math.floor((vim.o.lines - height) / 2),
col = math.floor((vim.o.columns - width) / 2),
style = "minimal",
border = "rounded",
})
M.last_popup_win = win
M.last_popup_buf = buf
end
return M

View file

@ -0,0 +1,91 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
vim.opt.number = false
local icons = require("pcode.user.icons").ui
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- initialisasi plugins
local importdata = {
{ import = "pcode.plugins" },
}
-- load theme
local theme = pcode.themes or {}
for key, _ in pairs(theme) do
table.insert(importdata, { import = "pcode.plugins.theme." .. key })
end
-- load extras plugins
local extras = pcode.extras or {}
for key, value in pairs(extras) do
if value then
table.insert(importdata, { import = "pcode.plugins.extras." .. key })
end
end
-- load language config
local lang = pcode.lang or {}
for key, value in pairs(lang) do
if value then
table.insert(importdata, { import = "pcode.plugins.lang." .. key })
end
end
-- load transparant config
local transparant = pcode.transparent or false
if transparant then
table.insert(importdata, { import = "pcode.plugins.extras.transparent" })
end
-- add overide path
table.insert(importdata, { import = "pcode.user.custom" })
-- Setup lazy.nvim
require("lazy").setup({
spec = importdata,
ui = {
backdrop = 100, -- Menyeting backdrop UI
border = "rounded", -- Mengatur border UI ke rounded
browser = "chrome", -- Menggunakan Chrome sebagai browser default
throttle = 40, -- Menyeting throttle
custom_keys = {
["<localleader>l"] = false, -- Menonaktifkan kunci lokal leader l
},
icons = {
ft = icons.ft,
lazy = icons.Bell .. " ",
loaded = icons.CheckCircle,
not_loaded = icons.not_loaded,
},
},
change_detection = { enabled = false, notify = false }, -- Nonaktifkan deteksi perubahan
-- automatically check for plugin updates
checker = { enabled = true },
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

9
lua/pcode/core/init.lua Normal file
View file

@ -0,0 +1,9 @@
_G.pcode = _G.pcode or {}
require("pcode.user.default")
require("pcode.config.lazy_lib")
require("pcode.user.colorscheme")
require("pcode.core.neovide")
vim.keymap.set({ "n", "v", "x" }, "<C-i>", function()
require("gemini").ask_gemini()
end, { noremap = true, silent = true, desc = "Prompt Gemini CLI" })

View file

@ -0,0 +1,55 @@
_G.idxOf = function(array, value)
for i, v in ipairs(array) do
if v == value then
return i
end
end
return nil
end
_G.LAZYGIT_TOGGLE = function()
local ok = pcall(require, "toggleterm")
if not ok then
require("notify")("toggleterm not found!", "error")
return
end
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
lazygit:toggle()
end
_G.substring = function(text, key)
local index, _ = string.find(text, key)
if index then
return true
else
return false
end
end
_G.all_trim = function(s)
return s:match("^%s*(.-)%s*$")
end
_G.current_theme = function()
if pcode.themes then
local theme = ""
for _, value in pairs(pcode.themes or {}) do
theme = value
end
return all_trim(theme)
end
return ""
end
local function safeRequire(module)
local ok, result = pcall(require, module)
if ok then
return result
end
end
safeRequire("pcode.user.options")
safeRequire("pcode.user.autocmd")
safeRequire("pcode.user.keymaps")
return {}

View file

@ -0,0 +1,95 @@
return {
{
"williamboman/mason-lspconfig.nvim",
event = { "CmdlineEnter", "BufReadPre", "BufNewFile", "BufRead" },
dependencies = {
{ "pojokcodeid/auto-lsp.nvim", lazy = true },
{
"neovim/nvim-lspconfig",
lazy = true,
cmd = {
"LspInfo",
"LspInstall",
"LspUninstall",
},
config = function()
require("lspconfig.ui.windows").default_options.border = "rounded"
end,
},
{
"williamboman/mason.nvim",
lazy = true,
build = ":MasonUpdate",
opts_extend = { "ensure_installed" },
cmd = {
"Mason",
"MasonInstall",
"MasonUninstall",
"MasonUninstallAll",
"MasonLog",
},
opts = function(_, opts)
local icons = require("pcode.user.icons").ui
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "stylua" })
opts.ui = {
-- border = "none",
border = icons.Border,
icons = {
package_pending = icons.Pending,
package_installed = icons.CheckCircle,
package_uninstalled = icons.BlankCircle,
},
keymaps = {
toggle_server_expand = "<CR>",
install_server = "i",
update_server = "u",
check_server_version = "c",
update_all_servers = "U",
check_outdated_servers = "C",
uninstall_server = "X",
},
}
opts.log_level = vim.log.levels.INFO
opts.max_concurrent_installers = 4
return opts
end,
config = function(_, opts)
require("mason").setup(opts)
local mr = require("mason-registry")
mr:on("package:install:success", function()
vim.defer_fn(function()
-- trigger FileType event to possibly load this newly installed LSP server
require("lazy.core.handler.event").trigger({
event = "FileType",
buf = vim.api.nvim_get_current_buf(),
})
end, 100)
end)
mr.refresh(function()
for _, tool in ipairs(opts.ensure_installed) do
local p = mr.get_package(tool)
if not p:is_installed() then
p:install()
end
end
end)
end,
},
},
opts = function(_, opts)
opts.skip_config = opts.skip_config or {}
opts.ensure_installed = opts.ensure_installed or {}
opts.automatic_installation = true
vim.list_extend(opts.ensure_installed, { "lua_ls" })
opts.format_on_save = true -- if use none-ls set true
opts.virtual_text = true
opts.timeout_ms = 5000
return opts
end,
config = function(_, opts)
require("auto-lsp").setup(opts)
end,
},
}

View file

@ -0,0 +1,50 @@
return {
{ "nvim-lua/plenary.nvim", event = "VeryLazy" },
{
"nvim-treesitter/nvim-treesitter",
event = { "BufRead", "VeryLazy" },
version = false,
build = ":TSUpdate",
lazy = true,
cmd = {
"TSInstall",
-- "TSInstallInfo",
"TSInstallSync",
"TSUpdate",
"TSUpdateSync",
"TSUninstall",
"TSUninstallInfo",
"TSInstallFromGrammar",
},
opts = function()
return {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" },
incremental_selection = {
enable = true,
},
autopairs = {
enable = true,
},
}
end,
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
---@type table<string, boolean>
local added = {}
opts.ensure_installed = vim.tbl_filter(function(lang)
if added[lang] then
return false
end
added[lang] = true
return true
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
vim.api.nvim_create_user_command("TSInstallInfo", function()
vim.cmd("Telescope treesitter_info")
end, {})
end,
},
}

View file

@ -0,0 +1,35 @@
return {
"windwp/nvim-autopairs",
lazy = true,
dependencies = "hrsh7th/nvim-cmp",
event = "InsertEnter",
opts = {
check_ts = true,
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
java = false,
},
disable_filetype = { "TelescopePrompt", "spectre_panel" },
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", '"', "'", "`" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
offset = 0, -- Offset from pattern match
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
check_comma = true,
highlight = "PmenuSel",
highlight_grey = "LineNr",
},
},
config = function(_, opts)
require("nvim-autopairs").setup(opts)
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
end,
}

View file

@ -0,0 +1,6 @@
return {
"windwp/nvim-ts-autotag",
lazy = true,
event = { "BufRead", "InsertEnter" },
opts = {},
}

View file

@ -0,0 +1,82 @@
local M = {
"goolord/alpha-nvim",
event = "VimEnter",
}
M.opts = {
dash_model = {
[[ _ __ __ ]],
[[ ___ ___ (____ / /__ _______ ___/ ___ ]],
[[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]],
[[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]],
[[ /_/ |___/ ]],
},
}
function M.config(_, opts)
local alpha = require("alpha")
local startify = require("alpha.themes.startify")
startify.section.header.val = pcode.dashboard or opts.dash_model
startify.section.top_buttons.val = {
startify.button("F", "󰈞 Find file", ":Telescope find_files <CR>"),
startify.button("e", " New file", ":ene <BAR> startinsert <CR>"),
startify.button("p", "󰉋 Find project", ":Telescope projects <CR>"),
startify.button("r", "󰦛 Recently used files", ":Telescope oldfiles <CR>"),
startify.button("t", "󰊄 Find text", ":Telescope live_grep <CR>"),
startify.button("c", " Configuration", ":e $MYVIMRC <CR>"),
startify.button("l", "󰒲 Lazy", ":Lazy<CR>"),
startify.button("q", "󰅚 Quit", ":qa<CR>"),
}
-- disable MRU
startify.section.mru.val = { { type = "padding", val = 4 } }
-- disable MRU cwd
startify.section.mru_cwd.val = { { type = "padding", val = 0 } }
-- disable nvim_web_devicons
startify.nvim_web_devicons.enabled = false
startify.section.bottom_buttons.val = {}
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
desc = "Add Alpha dashboard footer",
once = true,
callback = function()
local stats = require("lazy").stats()
local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
-- stylua: ignore
startify.section.footer.val = {
-- {
-- type = "text",
-- val = {"───────────────────────────────────────────"},
-- },
{
type = "text",
val = {
"⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins  in " .. ms .. "ms",
},
},
-- {
-- type = "text",
-- val = {"───────────────────────────────────────────"},
-- },
}
pcall(vim.cmd.AlphaRedraw)
end,
})
vim.api.nvim_create_autocmd({ "User" }, {
pattern = { "AlphaReady" },
callback = function()
vim.cmd([[
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
]])
end,
})
-- ignore filetypes in MRU
local default_mru_ignore = {}
startify.mru_opts.ignore = function(path, ext)
return (string.find(path, "COMMIT_EDITMSG")) or (vim.tbl_contains(default_mru_ignore, ext))
end
alpha.setup(startify.config)
end
return M

View file

@ -0,0 +1,34 @@
return {
"akinsho/bufferline.nvim",
branch = "main",
event = { "BufRead", "InsertEnter", "BufNewFile" },
dependencies = "pojokcodeid/auto-bufferline.nvim",
config = function()
vim.opt.termguicolors = true
local config = require("auto-bufferline").config()
require("bufferline").setup(config)
end,
keys = {
{ "<leader>b", "", desc = "  Buffers", mode = "n" },
{
"<leader>bb",
function()
require("telescope.builtin").buffers(require("telescope.themes").get_dropdown({ previewer = false }))
end,
desc = "All Buffer",
mode = "n",
},
{
"<leader>bc",
function()
require("auto-bufferline.configs.utils").bufremove()
end,
desc = "Close current buffer",
mode = "n",
},
{ "<leader>bd", "<cmd>BufferLineCloseLeft<cr>", desc = "Close Buffer Left", mode = "n" },
{ "<leader>bD", "<cmd>BufferLineCloseRight<cr>", desc = "Close Buffer Right", mode = "n" },
{ "<leader>ba", "<cmd>BufferLineCloseOthers<cr>", desc = "Close Buffer Other", mode = "n" },
{ "<leader>bA", "<cmd>BufferLineCloseOthers<cr><cmd>bd!<cr>", desc = "Close Buffer All", mode = "n" },
},
}

151
lua/pcode/plugins/cmp.lua Normal file
View file

@ -0,0 +1,151 @@
return {
{
"L3MON4D3/LuaSnip",
event = "InsertEnter",
version = "v2.*",
-- build = "make install_jsregexp",
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
},
{
"hrsh7th/nvim-cmp",
version = false, -- last release is way too old
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lua",
"xzbdmw/colorful-menu.nvim",
"lukas-reineke/cmp-rg",
},
opts = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local check_backspace = function()
local col = vim.fn.col(".") - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
end
return {
completion = {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
fallback()
else
fallback()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
{ name = "nvim_lua" },
{ name = "rg" },
}),
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
vim_item.menu = vim.api.nvim_get_mode().mode == "c" and "" or all_trim(vim_item.kind)
vim_item.kind = string.format("%s", all_trim(require("pcode.user.icons")["kind2"][vim_item.kind]))
local original_notify = vim.notify
vim.notify = function(msg, level, opts)
if type(msg) == "string" and msg:match("has new line character, please open an issue") then
return
end
original_notify(msg, level, opts)
end
local ok, highlights_info = pcall(require("colorful-menu").cmp_highlights, entry)
if ok and highlights_info ~= nil then
vim_item.abbr_hl_group = highlights_info.highlights
-- ambil nama group hilightnya saja
-- eg. "@parameter"
local var_hilight = highlights_info.highlights[1][1]
local id = vim.fn.hlID(var_hilight)
local var_out = "@tag"
-- cek apakah hilight terdefinisi
if id ~= 0 then
var_out = var_hilight
else
var_out = var_hilight:match("([^%.]+)")
end
vim_item.menu_hl_group = var_out
-- vim.notify(var_out)
else
vim_item.abbr_hl_group = "CmpItemAbbr"
vim_item.menu_hl_group = "CmpItemAbbr"
end
return vim_item
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
experimental = {
ghost_text = false,
native_menu = false,
},
}
end,
},
{
"rafamadriz/friendly-snippets",
event = "InsertEnter",
lazy = true,
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("pcode.user.snippets")
end,
},
}

View file

@ -1,22 +1,4 @@
return {
-- for auto complate commond mode
-- {
-- "gelguy/wilder.nvim",
-- lazy = true,
-- event = "VeryLazy",
-- config = function()
-- local wilder = require("wilder")
-- wilder.setup({ modes = { ":", "/", "?" } })
-- wilder.set_option(
-- "renderer",
-- wilder.popupmenu_renderer({
-- highlighter = wilder.basic_highlighter(),
-- left = { " ", wilder.popupmenu_devicons() },
-- right = { " ", wilder.popupmenu_scrollbar() },
-- })
-- )
-- end,
-- },
{
"folke/noice.nvim",
lazy = true,
@ -24,8 +6,7 @@ return {
dependencies = {
{ "MunifTanjim/nui.nvim" },
},
-- event = "BufWinEnter",
event = "VeryLazy",
event = "CmdlineEnter",
opts = {
messages = {
enabled = false,
@ -44,6 +25,13 @@ return {
enabled = false,
},
},
presets = {
-- Preset ini menyesuaikan bentuk cursor pada mode commond
command_bar_cursor = {
enabled = true,
cursor_shape = "ver30", -- "ver" menandakan bar vertikal, 30 adalah tinggi dalam persen
},
},
},
keys = {
{
@ -103,7 +91,8 @@ return {
},
{
"hrsh7th/cmp-cmdline",
event = "VeryLazy",
-- event = "VeryLazy",
event = "CmdlineEnter",
config = function()
local cmp = require("cmp")
local mapping = {

View file

@ -12,47 +12,53 @@ local rfile = {
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
javascript = 'node "$dir/$fileName"',
-- go = "go run .",
go = "go run $fileName",
}
local runscript = pcode.coderunner or {}
rfile = vim.tbl_deep_extend("force", runscript, rfile)
local runProject = {}
local cwd = vim.fn.getcwd()
local go_mod_path = cwd .. "/go.mod"
if vim.fn.filereadable(go_mod_path) ~= 0 then
runProject[cwd] = {
name = "Go Project (cwd)",
command = "go run .",
}
end
return {
"CRAG666/code_runner.nvim",
lazy = true,
cmd = { "RunCode", "RunFile", "RunProject", "RunClose" },
opts = {
-- put here the commands by filetype
filetype = rfile,
-- mode = "term",
project = runProject,
mode = "float",
focus = true,
startinsert = true,
term = {
--position = "vert",
position = "bot",
size = 50,
},
float = {
-- Key that close the code_runner floating window
close_key = "<ESC>",
-- Window border (see ':h nvim_open_win')
border = "rounded",
-- Num from `0 - 1` for measurements
height = 0.8,
width = 0.8,
x = 0.5,
y = 0.5,
-- Highlight group for floating window/border (see ':h winhl')
border_hl = "FloatBorder",
float_hl = "Normal",
-- Transparency (see ':h winblend')
blend = 0,
},
},
config = function(_, opts)
require("code_runner").setup(opts)
end,
keys = {
{ "<leader>r", "", desc = "  Run", mode = "n" },
{ "<leader>rr", "<cmd>RunCode<CR>", desc = "Run Code", mode = "n" },
{ "<leader>rf", "<cmd>RunFile<CR>", desc = "Run File", mode = "n" },
{ "<leader>rp", "<cmd>RunProject<CR>", desc = "Run Project", mode = "n" },
},
}

View file

@ -0,0 +1,29 @@
return {
"numToStr/Comment.nvim",
event = "VeryLazy",
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
opts = function()
return {
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
}
end,
keys = {
{
"<leader>/",
"<Plug>(comment_toggle_linewise_current)",
desc = "󰆈 Coment line",
mode = "n",
},
{
"<leader>/",
"<Plug>(comment_toggle_linewise_visual)",
desc = "󰆈 Coment line",
mode = "v",
},
},
config = function(_, opts)
require("Comment").setup(opts)
end,
}

View file

@ -0,0 +1,43 @@
return {
"pojokcodeid/auto-conform.nvim",
dependencies = {
"williamboman/mason.nvim",
"stevearc/conform.nvim",
},
event = "BufRead",
opts = function(_, opts)
opts.formatters = opts.formatters or {}
opts.formatters_by_ft = opts.formatters_by_ft or {}
opts.ensure_installed = opts.ensure_installed or {}
-- vim.list_extend(opts.ensure_installed, { "stylua" })
opts.lang_maps = opts.lang_maps or {}
opts.name_maps = opts.name_maps or {}
opts.add_new = opts.add_new or {}
opts.ignore = opts.ignore or {}
opts.format_on_save = opts.format_on_save or true
opts.format_timeout_ms = opts.format_timeout_ms or 5000
end,
config = function(_, opts)
require("auto-conform").setup(opts)
-- other conform config
local conform = require("conform")
if opts.format_on_save then
conform.setup({
format_on_save = {
lsp_fallback = true,
timeout_ms = opts.format_timeout_ms or 5000,
},
})
end
vim.keymap.set({ "n", "v" }, "<leader>lF", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = opts.format_timeout_ms or 5000,
})
end, { desc = "Format file or range (in visual mode)" })
end,
keys = {
{ "<leader>l", "", desc = "󰘦 Lsp" },
},
}

View file

@ -8,10 +8,10 @@ return {
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
--[[ vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end ]]
end,
opts = {
input = {

View file

@ -0,0 +1,49 @@
return {
"okuuva/auto-save.nvim",
version = "^1.0.0", -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release
cmd = "ASToggle", -- optional for lazy loading on command
event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events
opts = {
enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it)
trigger_events = { -- See :h events
immediate_save = { "BufLeave", "FocusLost" }, -- vim events that trigger an immediate save
defer_save = { "InsertLeave", "TextChanged" }, -- vim events that trigger a deferred save (saves after `debounce_delay`)
cancel_deferred_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save
},
-- function that takes the buffer handle and determines whether to save the current buffer or not
-- return true: if buffer is ok to be saved
-- return false: if it's not ok to be saved
-- if set to `nil` then no specific condition is applied
condition = nil,
write_all_buffers = false, -- write all buffers when the current one meets `condition`
noautocmd = false, -- do not execute autocmds when saving
lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details
debounce_delay = 1500, -- delay after which a pending save is executed
-- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable
debug = false,
},
config = function(_, opts)
require("auto-save").setup(opts)
local group = vim.api.nvim_create_augroup("autosave", {})
vim.api.nvim_create_autocmd("User", {
pattern = "AutoSaveWritePost",
group = group,
callback = function(opts)
local ftype = vim.bo.filetype
if opts.data.saved_buffer ~= nil and ftype ~= "TelescopePrompt" and not substring(tostring(ftype), "dap") then
local filename = vim.api.nvim_buf_get_name(opts.data.saved_buffer)
local is_ok = pcall(require, "notify")
if is_ok then
require("notify")("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"))
else
print("AutoSave: saved " .. filename .. " at " .. vim.fn.strftime("%H:%M:%S"))
end
end
end,
})
end,
keys = {
{ "<leader>n", ":ASToggle<CR>", desc = "󰨚 Toggle auto-save" },
},
}

View file

@ -0,0 +1,73 @@
return {
"pojokcodeid/cheatsheet-nvim",
event = "VeryLazy",
keys = {
{ "<F1>", "<cmd>KeymapsPopup<cr>", desc = "Keymaps Popup" },
},
cmd = { "KeymapsPopup" },
opts = {
["LSP"] = {
{ "LSP Code Action", "n", "<leader>la" },
{ "LSP Code Format", "n", "<leader>lf" },
{ "LSP Information", "n", "<leader>li" },
{ "Mason Information", "n", "<leader>lI" },
{ "LSP Next Diagnostic", "n", "<leader>lj" },
{ "LSP Previous Diagnostic", "n", "<leader>lk" },
{ "LSP Quickfix", "n", "<leader<lq" },
{ "LSP Rename", "n", "<leader>lr" },
{ "LSP Signature Help", "n", "<leader>ls" },
{ "LSP Format On Range", "v", "<leader>lF" },
},
["Cmp"] = {
{ "Scroll Next Documentation", "i", "CTRL + f" },
{ "Scroll Previous Documentation", "i", "CTRL + b" },
{ "Mapping Complete", "i", "CTRL + space" },
{ "Abort Completion", "i", "CTRL + e" },
{ "Accept Completion", "i", "" },
{ "Next Autocompletion", "i", "TAB" },
{ "Previous Autocompletion", "i", "SHIFT + TAB" },
},
["Terminal"] = {
{ "Terminal Float", "n", "<leader>tf" },
{ "Terminal Horizontal", "n", "<leader>th" },
{ "Terminal new tab", "n", "<leader>ts" },
{ "Terminal Vertical", "n", "<leader>tv" },
{ "Terminal Close", "n", "<leader>tx" },
},
["Comment"] = {
{ "Comment line toggle", "n/v", "gcc or CTRL + /" },
{ "Comment block toggle", "n/v", "gbc or CTRL + /" },
{ "Comment visual selection", "v", "gc" },
{ "Comment visual selection using block delimiters", "v", "gb" },
{ "Comment out text object line wise", "v", "gc<motion>" },
{ "Comment out text object block wise", "v", "gb<motion>" },
{ "Add comment on the line above", "n", "gcO" },
{ "Add comment on the line below", "n", "gco" },
{ "Add comment at the end of line", "n", "gcA" },
},
["Bufferline"] = {
{ "Move Active Buffer Left", "n", "SHIFT + h/SHIFT + Left" },
{ "Move Active Buffer Right", "n", "SHIFT + l/SHIFT + Right" },
{ "Reorder Bufferline", "n", "SHIFT + PageUp/PageDown" },
{ "Close Current Buffer", "n", "SHIFT + t" },
},
["Window"] = {
{ "Resize Window", "n", "CTRL + Left/Right/Up/Down" },
{ "Navigate Window", "n", "CTRL + h/l" },
},
["Text-Manipulation"] = {
{ "Select Multiple Cursor Vertical", "n/i", "SHIFT + ALT + Up/Down" },
{ "Select text", "n", "CTRL + d" },
{ "Select Multiple Cursor", "i/n", "ALT + Left Click Mouse" },
{ "Duplicate Row", "i/n/v", "SHIFT + ALT + Up/Down" },
{ "Move Row", "i/n/v", "ALT + Up/Down" },
},
["Ai"] = {
{ "Approve AI Sugention", "i", "CTRL + g" },
{ "Change AI Option", "i", "CTRL + Up/Down" },
{ "Clear AI Sugention", "i", "CTRL + x" },
},
},
config = true,
}

View file

@ -0,0 +1,33 @@
return {
"exafunction/codeium.vim",
enabled = true,
-- for fix notwork new version
-- https://github.com/exafunction/codeium.vim/issues/376#issuecomment-2159643405
-- version = "1.8.37",
-- event = "bufwinenter",
-- event = "bufenter",
-- event = "insertenter",
event = { "VeryLazy", "bufreadpre", "bufnewfile", "bufread" },
build = ":Codeium Auth",
cmd = { "CodeiumChat" },
config = function()
vim.g.codeium_disable_bindings = 1
-- Change '<C-g>' here to any keycode you like.
vim.keymap.set("i", "<C-g>", function()
return vim.fn["codeium#Accept"]()
end, { expr = true, silent = true })
vim.keymap.set("i", "<c-Up>", function()
return vim.fn["codeium#CycleCompletions"](1)
end, { expr = true, silent = true })
vim.keymap.set("i", "<c-Down>", function()
return vim.fn["codeium#CycleCompletions"](-1)
end, { expr = true, silent = true })
vim.keymap.set("i", "<c-x>", function()
return vim.fn["codeium#Clear"]()
end, { expr = true, silent = true })
end,
keys = {
{ "<leader>c", ":CodeiumChat<cr>", desc = "󰭹 codeium chat", mode = "n" },
},
}

View file

@ -0,0 +1,38 @@
return {
-- codeium cmp source
{
"nvim-cmp",
event = "BufReadPre",
dependencies = {
-- codeium
{
"Exafunction/windsurf.nvim",
cmd = "Codeium",
enabled = true,
opts = {
enable_chat = true,
enable_cmp_source = true,
virtual_text = {
enabled = true,
key_bindings = {
accept = "<c-g>",
next = "<c-Down>",
prev = "<c-Up>",
},
},
},
config = function(_, opts)
require("codeium").setup(opts)
end,
},
},
--@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, 1, {
name = "codeium",
group_index = 1,
priority = 100,
})
end,
},
}

View file

@ -0,0 +1,62 @@
return {
{
"rcarriga/nvim-dap-ui",
lazy = true,
event = "BufRead",
dependencies = {
{ "mfussenegger/nvim-dap", lazy = true },
{ "nvim-neotest/nvim-nio", lazy = true },
{
"theHamsta/nvim-dap-virtual-text",
opts = {
virt_text_win_col = 80,
},
},
},
config = function()
require("pcode.user.dapui")
end,
keys = {
{ "<leader>d", "", desc = "  Debug" },
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
},
},
{
"jay-babu/mason-nvim-dap.nvim",
lazy = true,
event = "BufRead",
dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" },
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, {})
opts.automatic_setup = true
opts.handlers = {
function(config)
-- all sources with no handler get passed here
-- Keep original functionality
require("mason-nvim-dap").default_setup(config)
end,
}
return opts
end,
-- enabled = vim.fn.has("win32") == 0,
config = function(_, opts)
require("mason").setup()
require("mason-nvim-dap").setup(opts)
end,
},
}

View file

@ -0,0 +1,7 @@
return {
"rachartier/tiny-devicons-auto-colors.nvim",
event = "VeryLazy",
config = function()
require("tiny-devicons-auto-colors").setup()
end,
}

View file

@ -0,0 +1,35 @@
return {
"pojokcodeid/dressing.nvim",
lazy = true,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
-- vim.ui.input = function(...)
-- require("lazy").load({ plugins = { "dressing.nvim" } })
-- return vim.ui.input(...)
-- end
end,
opts = {
input = {
enabled = false,
title_pos = "center",
relative = "editor",
default_prompt = "",
win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" },
prefer_width = 30,
max_width = { 140, 0.9 },
min_width = { 50, 0.2 },
},
select = {
backend = { "telescope", "builtin" },
builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } },
},
},
config = function(_, opts)
require("dressing").setup(opts)
end,
}

View file

@ -0,0 +1,14 @@
return {
"j-hui/fidget.nvim",
lazy = true,
tag = "legacy",
event = "BufRead",
config = function()
require("fidget").setup({
window = {
blend = 0,
relative = "editor",
},
})
end,
}

View file

@ -0,0 +1,65 @@
local M = {
"RRethy/vim-illuminate",
event = "BufRead",
}
M.opts = {
delay = 200,
large_file_cutoff = 2000,
large_file_overrides = {
providers = { "lsp" },
},
filetypes_denylist = {
"mason",
"harpoon",
"DressingInput",
"NeogitCommitMessage",
"qf",
"dirvish",
"oil",
"minifiles",
"fugitive",
"alpha",
"NvimTree",
"lazy",
"NeogitStatus",
"Trouble",
"netrw",
"lir",
"DiffviewFiles",
"Outline",
"Jaq",
"spectre_panel",
"toggleterm",
"DressingSelect",
"TelescopePrompt",
},
}
function M.config(_, opts)
require("illuminate").configure(opts)
local function map(key, dir, buffer)
vim.keymap.set("n", key, function()
require("illuminate")["goto_" .. dir .. "_reference"](false)
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
end
map("]]", "next")
map("[[", "prev")
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
vim.api.nvim_create_autocmd("FileType", {
callback = function()
local buffer = vim.api.nvim_get_current_buf()
map("]]", "next", buffer)
map("[[", "prev", buffer)
end,
})
end
M.keys = {
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
}
return M

View file

@ -0,0 +1,36 @@
local icons = require("pcode.user.icons")
return {
"echasnovski/mini.indentscope",
version = false, -- wait till new 0.7.0 release to put it back on semver
event = "BufReadPre",
opts = {
symbol = icons.ui.LineMiddle,
options = { try_as_border = true },
},
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"alpha",
"dashboard",
"fzf",
"help",
"lazy",
"lazyterm",
"mason",
"neo-tree",
"NvimTree",
"notify",
"toggleterm",
"Trouble",
"trouble",
"term",
"terminal",
"zsh",
"keymaps_table",
},
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end,
}

View file

@ -0,0 +1,10 @@
return {
"barrett-ruth/live-server.nvim",
build = "npm i -g live-server",
cmd = { "LiveServerStart", "LiveServerStop", "LiveServerToggle" },
config = true,
keys = {
-- open http://localhost:5555/ jika menggunakan wsl
{ "<leader>rl", "<cmd>LiveServerToggle<cr>", desc = "LiveServer" },
},
}

View file

@ -0,0 +1,23 @@
return {
"ray-x/lsp_signature.nvim",
event = "VeryLazy",
opts = function()
local is_enabled = true
return {
-- Window mode
floating_window = is_enabled, -- Display it as floating window.
hi_parameter = "IncSearch", -- Color to highlight floating window.
handler_opts = { border = "rounded" }, -- Window style
-- Hint mode
hint_enable = false, -- Display it as hint.
hint_prefix = "👈 ",
-- Additionally, you can use <space>uH to toggle inlay hints.
toggle_key_flip_floatwin_setting = is_enabled,
}
end,
config = function(_, opts)
require("lsp_signature").setup(opts)
end,
}

View file

@ -0,0 +1,40 @@
return {
-- animations
{
"echasnovski/mini.animate",
event = "BufRead",
opts = function()
-- don't use animate when scrolling with the mouse
local mouse_scrolled = false
for _, scroll in ipairs({ "Up", "Down" }) do
local key = "<ScrollWheel" .. scroll .. ">"
vim.keymap.set({ "", "i" }, key, function()
mouse_scrolled = true
return key
end, { expr = true })
end
local animate = require("mini.animate")
return {
resize = {
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
},
scroll = {
timing = animate.gen_timing.linear({ duration = 150, unit = "total" }),
subscroll = animate.gen_subscroll.equal({
predicate = function(total_scroll)
if mouse_scrolled then
mouse_scrolled = false
return false
end
return total_scroll > 1
end,
}),
},
}
end,
config = function(_, opts)
require("mini.animate").setup(opts)
end,
},
}

View file

@ -0,0 +1,35 @@
local M = {
"SmiteshP/nvim-navic",
event = "BufRead",
dependencies = {
"LunarVim/breadcrumbs.nvim",
opts = {},
config = true,
},
}
function M.config()
local icons = require("pcode.user.icons").kind
for key, value in pairs(icons) do
icons[key] = value .. " "
end
require("nvim-navic").setup({
icons = icons,
lsp = {
auto_attach = true,
preference = nil,
},
highlight = false,
separator = " > ",
depth_limit = 0,
depth_limit_indicator = "..",
safe_output = true,
lazy_update_context = false,
click = false,
format_text = function(text)
return text
end,
})
end
return M

View file

@ -0,0 +1,72 @@
return {
"monkoose/neocodeium",
event = "VeryLazy",
config = function()
local uv = vim.uv
local fn = vim.fn
local pummenu_timer = assert(uv.new_timer())
local cmp = require("cmp")
local neocodeium = require("neocodeium")
local renderer = require("neocodeium.renderer")
local completer = require("neocodeium.completer")
local function is_noselect()
local completeopt = vim.o.completeopt
return completeopt:find("noselect") and -1 or 0
end
local default_selected_compl = is_noselect()
local selected_compl = default_selected_compl
-- if cmp menu_opened then neocodeium clear
cmp.event:on("menu_opened", function()
neocodeium.clear()
end)
neocodeium.setup({
filter = function()
return not cmp.visible()
end,
})
-- if cmp menu_is_closed then neocodeium activate
cmp.event:on("menu_closed", function()
local cur_selected = fn.complete_info({ "selected" }).selected
if selected_compl == cur_selected then
completer:initiate()
else
selected_compl = cur_selected
completer:clear(true)
renderer:display_label()
pummenu_timer:stop()
pummenu_timer:start(
400,
0,
vim.schedule_wrap(function()
if fn.pumvisible() == 1 then
completer:initiate()
end
end)
)
end
end)
vim.keymap.set("i", "<C-g>", function()
neocodeium.accept()
end)
vim.keymap.set("i", "<c-Down>", function()
neocodeium.cycle()
end)
vim.keymap.set("i", "<c-Up>", function()
require("neocodeium").cycle(-1)
end)
vim.keymap.set("i", "<c-x>", function()
require("neocodeium").clear()
end)
-- create user command CodeiumDiasable
vim.api.nvim_create_user_command("CodeiumDisable", function()
require("neocodeium.commands").disable(true)
end, {})
-- create user command CodeiumEnable
vim.api.nvim_create_user_command("CodeiumEnable", function()
require("neocodeium.commands").enable()
end, {})
end,
}

View file

@ -0,0 +1,36 @@
return {
{
"nvzone/menu",
lazy = true,
event = { "VeryLazy" },
dependencies = {
{ "nvzone/volt", lazy = true },
{ "nvzone/showkeys", cmd = "ShowkeysToggle", lazy = true },
{
"nvzone/minty",
cmd = { "Shades", "Huefy" },
lazy = true,
},
},
opts = {
mouse = true,
border = true,
},
config = function(_, opts)
-- Keyboard users
vim.keymap.set("n", "<C-t>", function()
require("menu").open("default")
end, {})
-- mouse users + nvimtree users!
vim.keymap.set({ "n", "v" }, "<RightMouse>", function()
require("menu.utils").delete_old_menus()
vim.cmd.exec('"normal! \\<RightMouse>"')
local buf = vim.api.nvim_win_get_buf(vim.fn.getmousepos().winid)
local options = vim.bo[buf].ft == "NvimTree" and "nvimtree" or "default"
require("menu").open(options, opts)
end, {})
end,
},
}

View file

@ -0,0 +1,107 @@
local M = { "kevinhwang91/nvim-ufo" }
M.event = "VeryLazy"
M.dependencies = {
"kevinhwang91/promise-async",
"luukvbaal/statuscol.nvim",
}
M.config = function()
local builtin = require("statuscol.builtin")
local cfg = {
setopt = true,
relculright = true,
segments = {
{ text = { builtin.foldfunc, " " }, click = "v:lua.ScFa", hl = "Comment" },
{ text = { "%s" }, click = "v:lua.ScSa" },
{ text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
},
}
require("statuscol").setup(cfg)
vim.o.foldcolumn = "1" -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
vim.o.fillchars = [[eob: ,fold: ,foldopen:▾,foldsep: ,foldclose:▸]]
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
local handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local suffix = (" 󰡏 %d "):format(endLnum - lnum)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
chunkText = truncate(chunkText, targetWidth - curWidth)
local hlGroup = chunk[2]
table.insert(newVirtText, { chunkText, hlGroup })
chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- str width returned from truncate() may less than 2nd argument, need padding
if curWidth + chunkWidth < targetWidth then
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
end
break
end
curWidth = curWidth + chunkWidth
end
table.insert(newVirtText, { suffix, "MoreMsg" })
return newVirtText
end
local ftMap = {
-- typescriptreact = { "lsp", "treesitter" },
-- python = { "indent" },
-- git = "",
}
require("ufo").setup({
fold_virt_text_handler = handler,
close_fold_kinds = {},
-- close_fold_kinds = { "imports", "comment" },
provider_selector = function(bufnr, filetype, buftype)
-- if you prefer treesitter provider rather than lsp,
-- return ftMap[filetype] or {'treesitter', 'indent'}
return ftMap[filetype]
-- return { "treesitter", "indent" }
-- refer to ./doc/example.lua for detail
end,
preview = {
win_config = {
border = { "", "", "", "", "", "", "", "" },
winhighlight = "Normal:Folded",
winblend = 0,
},
mappings = {
scrollU = "<C-k>",
scrollD = "<C-j>",
jumpTop = "[",
jumpBot = "]",
},
},
})
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
vim.keymap.set("n", "zr", require("ufo").openFoldsExceptKinds)
vim.keymap.set("n", "zm", require("ufo").closeFoldsWith) -- closeAllFolds == closeFoldsWith(0)
vim.keymap.set("n", "K", function()
local winid = require("ufo").peekFoldedLinesUnderCursor()
if not winid then
vim.lsp.buf.hover()
end
end)
end
return M

View file

@ -2,6 +2,7 @@ return {
"hiphish/rainbow-delimiters.nvim",
lazy = true,
event = "BufRead",
branch = "master",
config = function()
-- Modul ini berisi beberapa definisi default
local rainbow_delimiters = require("rainbow-delimiters")

View file

@ -0,0 +1,49 @@
return {
-- Incremental rename
{
"smjonas/inc-rename.nvim",
cmd = "IncRename",
-- stylua: ignore
keys = {
{"<leader>u","",desc="  Edit"},
{
"<leader>un",
function()
return ":IncRename " .. vim.fn.expand("<cword>")
end,
desc = "Incremental rename",
mode = "n",
noremap = true,
expr = true,
},
},
config = true,
},
{
"folke/noice.nvim",
optional = true,
opts = {
presets = { inc_rename = true },
},
},
-- Refactoring tool
{
"ThePrimeagen/refactoring.nvim",
keys = {
{
"<leader>r",
function()
require("refactoring").select_refactor({
show_success_message = true,
})
end,
mode = "v",
noremap = true,
silent = true,
expr = false,
desc = "  Refactoring",
},
},
opts = {},
},
}

View file

@ -0,0 +1,27 @@
vim.filetype.add({
extension = {
["http"] = "http",
},
})
return {
{
"mistweaverco/kulala.nvim",
ft = "http",
keys = {
{ "<leader>R", "", desc = " 󰖟 Rest" },
{ "<leader>Rs", "<cmd>lua require('kulala').run()<cr>", desc = "Send the request" },
{ "<leader>Rt", "<cmd>lua require('kulala').toggle_view()<cr>", desc = "Toggle headers/body" },
{ "<leader>Rp", "<cmd>lua require('kulala').jump_prev()<cr>", desc = "Jump to previous request" },
{ "<leader>Rn", "<cmd>lua require('kulala').jump_next()<cr>", desc = "Jump to next request" },
},
opts = {},
},
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "http", "graphql" })
return opts
end,
},
}

View file

@ -0,0 +1,46 @@
-- install luarock
-- sudo apt-get install luarocks lua5.4 (untuk linux)
-- https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Windows
-- manual penggunaan
-- https://www.jetbrains.com/help/idea/exploring-http-syntax.html
return {
"rest-nvim/rest.nvim",
-- NOTE: Follow https://github.com/rest-nvim/rest.nvim/issues/306
-- commit = "91badd46c60df6bd9800c809056af2d80d33da4c",
event = "VeryLazy",
enabled = vim.fn.executable("luarocks") == 1,
dependencies = {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, { "http" })
end,
},
},
config = function()
require("rest-nvim").setup()
vim.api.nvim_create_autocmd("FileType", {
pattern = { "http", "httpResult" },
callback = function()
local opt = vim.opt
opt.number = false -- Print line number
opt.preserveindent = false -- Preserve indent structure as much as possible
opt.relativenumber = false
end,
})
end,
ft = "http",
keys = {
{
"<Leader>rh",
"<cmd>Rest run<cr>",
desc = "Run http request under cursor",
},
{
"<Leader>rH",
"<cmd>Rest last<cr>",
desc = "Run last http request",
},
},
}

Some files were not shown because too many files have changed in this diff Show more