├── .gitignore ├── .java-google-formatter.xml ├── .luacheckrc ├── .luarc.json ├── .markdownlint.json ├── .stylua.toml ├── .vale ├── gitlab │ ├── Acronyms.yml │ ├── Admin.yml │ ├── AlertBoxStyle.yml │ ├── BadgeCapitalization.yml │ ├── British.yml │ ├── CodeblockFences.yml │ ├── CurlStringsQuoted.yml │ ├── CurrentStatus.yml │ ├── DefaultBranch.yml │ ├── FutureTense.yml │ ├── HeaderGerunds.yml │ ├── InclusionAbleism.yml │ ├── InclusionCultural.yml │ ├── InclusionGender.yml │ ├── InternalLinkCase.yml │ ├── InternalLinkExtension.yml │ ├── InternalLinkFormat.yml │ ├── LatinTerms.yml │ ├── MeaningfulLinkWords.yml │ ├── MergeConflictMarkers.yml │ ├── NonStandardQuotes.yml │ ├── OutdatedVersions.yml │ ├── OxfordComma.yml │ ├── Possessive.yml │ ├── ReadingLevel.yml │ ├── ReferenceLinks.yml │ ├── RelativeLinksDoubleSlashes.yml │ ├── Repetition.yml │ ├── SentenceLength.yml │ ├── SentenceSpacing.yml │ ├── Simplicity.yml │ ├── Spelling.yml │ ├── SubstitutionSuggestions.yml │ ├── SubstitutionWarning.yml │ ├── Substitutions.yml │ ├── ToDo.yml │ ├── VersionText.yml │ ├── Wordy.yml │ └── spelling-exceptions.txt └── vale.tmpl ├── LICENSE ├── README.md ├── after ├── ftplugin │ ├── c.lua │ ├── c.vim │ ├── cmake.vim │ ├── cpp.lua │ ├── cpp.vim │ ├── crontab.vim │ ├── make.vim │ ├── qf.vim │ ├── scheme.vim │ ├── solidity.vim │ ├── tex.vim │ └── typescript.vim ├── queries │ └── markdown │ │ └── injections.scm └── syntax │ ├── dap-repl.vim │ ├── gomod.vim │ ├── hcl.vim │ ├── log.vim │ ├── lua.vim │ ├── make.vim │ ├── sh.vim │ ├── sql.vim │ ├── thrift.vim │ └── vimwiki.vim ├── config.lua ├── ftdetect └── term.vim ├── ftplugin ├── dap-repl.vim ├── dockerfile.lua ├── go.lua ├── java.lua ├── lua.lua ├── python.lua ├── tex.lua ├── toml.lua └── yaml.lua ├── lsp-settings ├── gopls.json ├── jdtls.json ├── lua_ls.json ├── pyright.json └── rust_analyzer.json ├── lua ├── lualine │ └── themes │ │ └── tokyonight.lua ├── telescope │ └── _extensions │ │ ├── file_create.lua │ │ └── luasnip.lua └── user │ ├── autocommands.lua │ ├── banners.lua │ ├── bqf.lua │ ├── bufferline.lua │ ├── builtin.lua │ ├── cle.lua │ ├── codelens.lua │ ├── colorizer.lua │ ├── copilot.lua │ ├── crates.lua │ ├── custom_user.lua │ ├── dap.lua │ ├── dashboard.lua │ ├── dev_icons.lua │ ├── diffview.lua │ ├── dress.lua │ ├── fidget_spinner.lua │ ├── flash.lua │ ├── flutter_tools.lua │ ├── fzf.lua │ ├── gps.lua │ ├── hlslens.lua │ ├── hop.lua │ ├── incline.lua │ ├── indent_blankline.lua │ ├── keybindings.lua │ ├── leap.lua │ ├── legendary.lua │ ├── lsp_kind.lua │ ├── lsp_signature.lua │ ├── lualine.lua │ ├── markv.lua │ ├── metals.lua │ ├── mind.lua │ ├── neoclip.lua │ ├── neotree.lua │ ├── neovim.lua │ ├── noice.lua │ ├── ntest.lua │ ├── null_ls │ ├── go.lua │ ├── helpers.lua │ ├── init.lua │ └── markdown.lua │ ├── orgmode.lua │ ├── outline.lua │ ├── ovs.lua │ ├── peek.lua │ ├── persist.lua │ ├── plugins.lua │ ├── presence.lua │ ├── project.lua │ ├── rust_tools.lua │ ├── sidebar.lua │ ├── spectre.lua │ ├── symbol_use.lua │ ├── symbols_outline.lua │ ├── tabout.lua │ ├── telescope.lua │ ├── tex.lua │ ├── theme.lua │ ├── todo_comments.lua │ ├── troubl.lua │ ├── tss.lua │ ├── twilight.lua │ ├── typtools.lua │ ├── vim_test.lua │ ├── vista.lua │ ├── which.lua │ ├── winb.lua │ └── zen.lua ├── selene.toml ├── snippets ├── lua.json ├── package.json ├── react-ts.json └── typescript.json ├── task_template.ini ├── tasks.ini ├── vale_config.ini └── vim.toml /.gitignore: -------------------------------------------------------------------------------- 1 | # Lazy spesific files 2 | lazy-lock.json 3 | 4 | 5 | # Compiled Lua sources 6 | luac.out 7 | .java-debug 8 | .vscode-java-test 9 | 10 | # Logs 11 | .nvimlog 12 | 13 | # luarocks build files 14 | *.src.rock 15 | *.zip 16 | *.tar.gz 17 | 18 | # Object files 19 | *.o 20 | *.os 21 | *.ko 22 | *.obj 23 | *.elf 24 | 25 | # Precompiled Headers 26 | *.gch 27 | *.pch 28 | 29 | # Libraries 30 | *.lib 31 | *.a 32 | *.la 33 | *.lo 34 | *.def 35 | *.exp 36 | 37 | # Shared objects (inc. Windows DLLs) 38 | *.dll 39 | *.so 40 | *.so.* 41 | *.dylib 42 | 43 | # Executables 44 | *.exe 45 | *.out 46 | *.app 47 | *.i*86 48 | *.x86_64 49 | *.hex 50 | 51 | # LunarVim 52 | plugin/packer_compiled.lua 53 | 54 | .luacheckcache 55 | 56 | # ETC 57 | .idea 58 | -------------------------------------------------------------------------------- /.luacheckrc: -------------------------------------------------------------------------------- 1 | -- vim: ft=lua tw=80 2 | 3 | stds.nvim = { 4 | globals = { 5 | "lvim", 6 | vim = { fields = { "g" } }, 7 | "CONFIG_PATH", 8 | "CACHE_PATH", 9 | "DATA_PATH", 10 | "TERMINAL", 11 | "USER", 12 | "C", 13 | "Config", 14 | "WORKSPACE_PATH", 15 | "JAVA_LS_EXECUTABLE", 16 | "MUtils", 17 | os = { fields = { "capture" } }, 18 | }, 19 | read_globals = { 20 | "jit", 21 | "os", 22 | "vim", 23 | -- vim = { fields = { "cmd", "api", "fn", "o" } }, 24 | }, 25 | } 26 | std = "lua51+nvim" 27 | 28 | -- Don't report unused self arguments of methods. 29 | self = false 30 | 31 | -- Rerun tests only if their modification time changed. 32 | cache = true 33 | 34 | ignore = { 35 | "631", -- max_line_length 36 | "212/_.*", -- unused argument, for vars with "_" prefix 37 | } 38 | -------------------------------------------------------------------------------- /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "workspace.checkThirdParty": false 3 | } -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "line-length": false, 3 | "no-inline-html": false 4 | } 5 | -------------------------------------------------------------------------------- /.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | quote_style = "AutoPreferDouble" 6 | no_call_parentheses = true 7 | -------------------------------------------------------------------------------- /.vale/gitlab/Acronyms.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.Acronyms 3 | # 4 | # Checks for unexpanded acronyms. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: conditional 8 | message: '"%s" has no definition.' 9 | link: https://about.gitlab.com/handbook/marketing/growth-marketing/content/editorial-team/#acronyms 10 | level: warning 11 | ignorecase: false 12 | # Ensures that the existence of 'first' implies the existence of 'second'. 13 | first: '\b([A-Z]{3,5})\b' 14 | second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)' 15 | # ... with the exception of these: 16 | exceptions: 17 | - AARW 18 | - ACG 19 | - ACID 20 | - ACK 21 | - ACL 22 | - ADC 23 | - ADFS 24 | - AES 25 | - AJAX 26 | - AMD 27 | - AMSI 28 | - ANSI 29 | - API 30 | - APT 31 | - ARINC 32 | - ARM 33 | - ARN 34 | - ARP 35 | - ASCII 36 | - ASIC 37 | - ASLR 38 | - ASN 39 | - ATA 40 | - AWS 41 | - BAR 42 | - BASLR 43 | - BCP 44 | - BEV 45 | - BFLA 46 | - BGP 47 | - BIOS 48 | - BNB 49 | - BOLA 50 | - BPDU 51 | - BSD 52 | - BSOD 53 | - BYOD 54 | - CAM 55 | - CAS 56 | - CASMM 57 | - CCSS 58 | - CDN 59 | - CET 60 | - CFG 61 | - CFI 62 | - CFT 63 | - CIS 64 | - CISO 65 | - CLI 66 | - CMD 67 | - CNA 68 | - CNAME 69 | - CNI 70 | - COM 71 | - CONOP 72 | - CORE 73 | - CORS 74 | - CPA 75 | - CPU 76 | - CRIME 77 | - CRLF 78 | - CRUD 79 | - CSI 80 | - CSPM 81 | - CSRF 82 | - CSS 83 | - CSV 84 | - CTF 85 | - CTI 86 | - CVE 87 | - CVS 88 | - DAC 89 | - DAG 90 | - DAO 91 | - DAST 92 | - DDOS 93 | - DEP 94 | - DEX 95 | - DHCP 96 | - DHT 97 | - DLL 98 | - DMA 99 | - DNS 100 | - DOM 101 | - DOS 102 | - DSA 103 | - DSS 104 | - DTD 105 | - DVCS 106 | - EAF 107 | - EAP 108 | - EAT 109 | - ECDH 110 | - ECDSA 111 | - ECH 112 | - ECS 113 | - EDR 114 | - EEA 115 | - EFS 116 | - EIGRP 117 | - EKS 118 | - ELF 119 | - ELK 120 | - EOL 121 | - EPA 122 | - ETC 123 | - ETCD 124 | - ETH 125 | - ETW 126 | - EVM 127 | - EXIF 128 | - FAQ 129 | - FIFO 130 | - FIN 131 | - FIPS 132 | - FOSS 133 | - FQDN 134 | - FREE 135 | - FTP 136 | - GCP 137 | - GDB 138 | - GDK 139 | - GDPR 140 | - GDT 141 | - GEO 142 | - GET 143 | - GIF 144 | - GKE 145 | - GNU 146 | - GOT 147 | - GPG 148 | - GPL 149 | - GPR 150 | - GPS 151 | - GPT 152 | - GPU 153 | - GSM 154 | - GSO 155 | - GUI 156 | - GUID 157 | - HAL 158 | - HAML 159 | - HDD 160 | - HDMI 161 | - HEAD 162 | - HIPAA 163 | - HMAC 164 | - HMP 165 | - HOTP 166 | - HSM 167 | - HSTS 168 | - HTA 169 | - HTML 170 | - HTTP 171 | - HTTPS 172 | - HVCI 173 | - IAF 174 | - IAM 175 | - IANA 176 | - IAT 177 | - IAVL 178 | - IBM 179 | - ICMP 180 | - ICO 181 | - ICS 182 | - IDA 183 | - IDE 184 | - IDOR 185 | - IDS 186 | - IGRP 187 | - IID 188 | - IMAP 189 | - IOC 190 | - IOCTL 191 | - IOPS 192 | - IPC 193 | - IPFS 194 | - IPS 195 | - IRC 196 | - IRP 197 | - IRQL 198 | - ISAC 199 | - ISF 200 | - ISN 201 | - ISO 202 | - ISS 203 | - IUM 204 | - JIT 205 | - JPEG 206 | - JPG 207 | - JSE 208 | - JSON 209 | - JVM 210 | - JWT 211 | - KASLR 212 | - KDC 213 | - KMCI 214 | - KMCS 215 | - KPTI 216 | - KVA 217 | - KVM 218 | - KYC 219 | - LAN 220 | - LDAP 221 | - LDAPS 222 | - LED 223 | - LEO 224 | - LESS 225 | - LFS 226 | - LIDAR 227 | - LLM 228 | - LLVM 229 | - LNK 230 | - LRU 231 | - LSA 232 | - LSASS 233 | - LSP 234 | - LTS 235 | - LUKS 236 | - MAC 237 | - MASLR 238 | - MBR 239 | - MDL 240 | - MDM 241 | - MEO 242 | - MEV 243 | - MFA 244 | - MIME 245 | - MIT 246 | - MITM 247 | - MMIO 248 | - MMU 249 | - MSA 250 | - MSI 251 | - MSSQL 252 | - MVC 253 | - NAC 254 | - NASA 255 | - NAT 256 | - NDA 257 | - NFS 258 | - NFT 259 | - NFV 260 | - NGFW 261 | - NGINX 262 | - NIST 263 | - NOTE 264 | - NPM 265 | - NTFS 266 | - NTLM 267 | - NTP 268 | - NVRAM 269 | - OCR 270 | - ONLY 271 | - OPA 272 | - OSI 273 | - OSINT 274 | - OSPF 275 | - OSS 276 | - OTP 277 | - OTR 278 | - OWASP 279 | - PAC 280 | - PAE 281 | - PAT 282 | - PCI 283 | - PCI-DSS 284 | - PDE 285 | - PDF 286 | - PEB 287 | - PEM 288 | - PEP 289 | - PGP 290 | - PHP 291 | - PID 292 | - PLT 293 | - PNG 294 | - POC 295 | - POP 296 | - POSIX 297 | - POST 298 | - PPP 299 | - PSP 300 | - PTE 301 | - PUT 302 | - QEMU 303 | - QFT 304 | - QMP 305 | - QUIC 306 | - RAID 307 | - RAM 308 | - RBAC 309 | - RCE 310 | - RDP 311 | - REST 312 | - RFB 313 | - RFC 314 | - RFI 315 | - RHEL 316 | - RIP 317 | - ROM 318 | - ROP 319 | - RPC 320 | - RPM 321 | - RPS 322 | - RRA 323 | - RSA 324 | - RSS 325 | - RST 326 | - RTL 327 | - RVA 328 | - RVM 329 | - SAAS 330 | - SAM 331 | - SAML 332 | - SANS 333 | - SAST 334 | - SATA 335 | - SBOM 336 | - SCA 337 | - SCADA 338 | - SCIM 339 | - SCORE 340 | - SCP 341 | - SCSS 342 | - SDDL 343 | - SDK 344 | - SDLC 345 | - SDN 346 | - SEH 347 | - SEHOP 348 | - SELF 349 | - SEO 350 | - SET 351 | - SFTP 352 | - SHA 353 | - SIEM 354 | - SIM 355 | - SIP 356 | - SLA 357 | - SLSA 358 | - SMAP 359 | - SMB 360 | - SMEP 361 | - SMS 362 | - SMTP 363 | - SNMP 364 | - SOAP 365 | - SOAR 366 | - SOC 367 | - SOP 368 | - SOX 369 | - SPDX 370 | - SPF 371 | - SPICE 372 | - SPN 373 | - SQL 374 | - SSD 375 | - SSDT 376 | - SSG 377 | - SSH 378 | - SSL 379 | - SSO 380 | - SSRF 381 | - SSTI 382 | - STIBP 383 | - SUID 384 | - SVG 385 | - SVN 386 | - SYN 387 | - TBA 388 | - TBD 389 | - TCC 390 | - TCP 391 | - TEB 392 | - TEE 393 | - TGT 394 | - TIFF 395 | - TIP 396 | - TLB 397 | - TLD 398 | - TLS 399 | - TODO 400 | - TOML 401 | - TOR 402 | - TOTP 403 | - TPM 404 | - TSC 405 | - TSS 406 | - TTL 407 | - TTP 408 | - TUI 409 | - UAC 410 | - UAF 411 | - UDP 412 | - UEFI 413 | - UNIX 414 | - URI 415 | - URL 416 | - USB 417 | - UTC 418 | - UTF 419 | - UTM 420 | - UUID 421 | - VBA 422 | - VBE 423 | - VBS 424 | - VCS 425 | - VHD 426 | - VLAN 427 | - VNC 428 | - VNF 429 | - VPC 430 | - VPN 431 | - VPS 432 | - VSS 433 | - WAF 434 | - WHQL 435 | - WIP 436 | - WMIC 437 | - WPAD 438 | - WSDL 439 | - WSH 440 | - WSL 441 | - XDR 442 | - XFG 443 | - XLAM 444 | - XLL 445 | - XML 446 | - XSL 447 | - XSS 448 | - XXE 449 | - YAML 450 | - ZAP 451 | - ZIP 452 | - ZSH 453 | -------------------------------------------------------------------------------- /.vale/gitlab/Admin.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.Admin 3 | # 4 | # Checks for "admin" and recommends using the full word instead. "Admin Area" is OK. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: substitution 8 | message: 'Verify this use of the word "admin". Can it be updated to "administration", "administrator", "administer", or "Admin Area"?' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html 10 | level: suggestion 11 | ignorecase: false 12 | swap: 13 | '[Aa]dmin ?\w*': '(?:Admin( Area| Mode)?|[Aa]dminist(ration|rator|rators|er|rative))' 14 | -------------------------------------------------------------------------------- /.vale/gitlab/AlertBoxStyle.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.AlertBoxStyle 3 | # 4 | # Makes sure alert boxes are used with block quotes. Checks for 3 formatting issues: 5 | # 6 | # - Alert boxes inside a block quote (">") 7 | # - Alert boxes with the note text on the same line 8 | # - Alert boxes using words other than "NOTE" or "WARNING" 9 | # 10 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 11 | extends: existence 12 | message: 'Alert box "%s" must use the formatting in the style guide.' 13 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#alert-boxes 14 | level: error 15 | nonword: true 16 | scope: raw 17 | raw: 18 | - '(\n *\> *(?:NOTE|WARNING)|' 19 | - '\n\n(NOTE|WARNING):[^\n]|' 20 | - '\n\n *(?:> )?\**(Note|note|TIP|Tip|tip|CAUTION|Caution|caution|DANGER|Danger|danger|Warning|warning):.*)' 21 | -------------------------------------------------------------------------------- /.vale/gitlab/BadgeCapitalization.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.BadgeCapitalization 3 | # 4 | # Verifies that badges are not mixed case, which won't render properly. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Badge "%s" must be capitalized.' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#product-tier-badges 10 | level: error 11 | scope: raw 12 | raw: 13 | - '\*\*\(([Ff]ree|[Pp]remium|[Uu]ltimate)( [Ss](elf|ass))?\)\*\*' 14 | -------------------------------------------------------------------------------- /.vale/gitlab/British.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.British 3 | # 4 | # Checks that US spelling is used instead of British spelling. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: substitution 8 | message: 'Use the US spelling "%s" instead of the British "%s".' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#language 10 | level: error 11 | ignorecase: true 12 | swap: 13 | aeon: eon 14 | aeroplane: airplane 15 | ageing: aging 16 | aluminium: aluminum 17 | anaemia: anemia 18 | anaesthesia: anesthesia 19 | analyse: analyze 20 | annexe: annex 21 | apologise: apologize 22 | behaviour: behavior 23 | busses: buses 24 | calibre: caliber 25 | categorise: categorize 26 | categorised: categorized 27 | categorises: categorizes 28 | categorising: categorizing 29 | centre: center 30 | cheque: check 31 | civilisation: civilization 32 | civilise: civilize 33 | colour: color 34 | cosy: cozy 35 | cypher: cipher 36 | dependant: dependent 37 | defence: defense 38 | distil: distill 39 | draught: draft 40 | encyclopaedia: encyclopedia 41 | enquiry: inquiry 42 | enrol: enroll 43 | enrolment: enrollment 44 | enthral: enthrall 45 | # equalled: equaled // Under discussion 46 | # equalling: equaling // Under discussion 47 | favourite: favorite 48 | fibre: fiber 49 | fillet: filet 50 | flavour: flavor 51 | furore: furor 52 | fulfil: fulfill 53 | gaol: jail 54 | grey: gray 55 | humour: humor 56 | honour: honor 57 | initialled: initialed 58 | initialling: initialing 59 | instil: instill 60 | jewellery: jewelry 61 | labelling: labeling 62 | labelled: labeled 63 | labour: labor 64 | libellous: libelous 65 | licence: license 66 | likeable: likable 67 | liveable: livable 68 | lustre: luster 69 | manoeuvre: maneuver 70 | marvellous: marvelous 71 | matt: matte 72 | meagre: meager 73 | metre: meter 74 | modelling: modeling 75 | moustache: mustache 76 | neighbour: neighbor 77 | normalise: normalize 78 | offence: offense 79 | organise: organize 80 | orientated: oriented 81 | paralyse: paralyze 82 | plough: plow 83 | pretence: pretense 84 | programme: program 85 | pyjamas: pajamas 86 | rateable: ratable 87 | realise: realize 88 | recognise: recognize 89 | reconnoitre: reconnoiter 90 | rumour: rumor 91 | sabre: saber 92 | saleable: salable 93 | saltpetre: saltpeter 94 | sceptic: skeptic 95 | sepulchre: sepulcher 96 | signalling: signaling 97 | sizeable: sizable 98 | skilful: skillful 99 | sombre: somber 100 | smoulder: smolder 101 | speciality: specialty 102 | splendour: splendor 103 | standardise: standardize 104 | standardised: standardized 105 | sulphur: sulfur 106 | theatre: theater 107 | travelled: traveled 108 | traveller: traveler 109 | travelling: traveling 110 | unshakeable: unshakable 111 | wilful: willful 112 | yoghurt: yogurt 113 | -------------------------------------------------------------------------------- /.vale/gitlab/CodeblockFences.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.CodeblockFences 3 | # 4 | # Ensures all codeblock language tags use the full name, not aliases. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Syntax highlighting hint "%s" must be one of: yaml, ruby, plaintext, markdown, javascript, shell, golang, python, dockerfile, or typescript.' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#code-blocks 10 | level: error 11 | scope: raw 12 | raw: 13 | - '\`\`\`(yml|rb|text|md|bash|sh\n|js\n|go\n|py\n|docker\n|ts)' 14 | -------------------------------------------------------------------------------- /.vale/gitlab/CurlStringsQuoted.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.CurlStringsQuoted 3 | # 4 | # Ensures all code blocks using `curl` wrap URL strings in quotation marks. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'For consistency across all cURL examples, always wrap the URL in double quotes ("): %s' 9 | link: https://docs.gitlab.com/ee/development/documentation/restful_api_styleguide.html#curl-commands 10 | level: error 11 | scope: raw 12 | raw: 13 | - 'curl.*[^"=]https?://.*' 14 | -------------------------------------------------------------------------------- /.vale/gitlab/CurrentStatus.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Suggestion: gitlab.CurrentStatus 3 | # 4 | # Checks for words that indicate a product or feature may change in the future. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Avoid words like "%s" that promise future changes, because documentation is about the current state of the product.' 9 | level: suggestion 10 | ignorecase: true 11 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#usage-list 12 | tokens: 13 | - currently 14 | -------------------------------------------------------------------------------- /.vale/gitlab/DefaultBranch.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.DefaultBranch 3 | # 4 | # Do not refer to the default branch as the "master" branch, if possible. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Use "default branch" or `main` instead of `master`, when possible.' 9 | level: warning 10 | ignorecase: true 11 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html 12 | scope: raw 13 | raw: 14 | - '\`master\`' 15 | -------------------------------------------------------------------------------- /.vale/gitlab/FutureTense.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Suggestion: gitlab.FutureTense 3 | # 4 | # Checks for use of future tense in sentences. Present tense is strongly preferred. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Avoid using future tense: "%s". Use present tense instead.' 9 | ignorecase: true 10 | level: warning 11 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#usage-list 12 | raw: 13 | - "(going to( |\n|[[:punct:]])[a-zA-Z]*|" 14 | - "will( |\n|[[:punct:]])[a-zA-Z]*|" 15 | - "won't( |\n|[[:punct:]])[a-zA-Z]*|" 16 | - "[a-zA-Z]*'ll( |\n|[[:punct:]])[a-zA-Z]*)" 17 | -------------------------------------------------------------------------------- /.vale/gitlab/HeaderGerunds.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Suggestion: gitlab.HeaderGerunds 3 | # 4 | # Checks for headers that start with gerunds (ing words). 5 | # Related to: https://docs.gitlab.com/ee/development/documentation/structure.html 6 | # 7 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 8 | extends: substitution 9 | message: 'Can this header start with an imperative verb, instead of a gerund (ing word)?' 10 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/#heading-titles 11 | level: suggestion 12 | scope: heading 13 | swap: 14 | - '^\w*ing.*': 'Troubleshooting' 15 | -------------------------------------------------------------------------------- /.vale/gitlab/InclusionAbleism.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Suggestion: gitlab.InclusionAbleism 3 | # 4 | # Suggests alternatives for words that foster ableism. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: substitution 8 | message: 'Use inclusive language. Consider "%s" instead of "%s".' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#inclusive-language 10 | level: suggestion 11 | ignorecase: true 12 | swap: 13 | sanity (?:check|test): check for completeness 14 | dummy: placeholder, sample, fake 15 | -------------------------------------------------------------------------------- /.vale/gitlab/InclusionCultural.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.InclusionCultural 3 | # 4 | # Suggests alternatives for words that are culturally inappropriate. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: substitution 8 | message: 'Use inclusive language. Consider "%s" instead of "%s".' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#inclusive-language 10 | level: warning 11 | ignorecase: true 12 | swap: 13 | blacklist(?:ed|ing|s)?: denylist 14 | whitelist(?:ed|ing|s)?: allowlist 15 | master: primary, main 16 | slave: secondary 17 | -------------------------------------------------------------------------------- /.vale/gitlab/InclusionGender.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Suggestion: gitlab.InclusionGender 3 | # 4 | # Suggests alternatives for words that are gender-specific. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: substitution 8 | message: 'Use inclusive language. Consider "%s" instead of "%s".' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#inclusive-language 10 | level: suggestion 11 | ignorecase: true 12 | swap: 13 | mankind: humanity, people 14 | manpower: GitLab team members 15 | he: they 16 | his: their 17 | she: they 18 | hers: their 19 | -------------------------------------------------------------------------------- /.vale/gitlab/InternalLinkCase.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.InternalLinkCase 3 | # 4 | # Checks that anchor fragments on internal links are in lower-case. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Links to subheadings in GitLab docs must be in lower-case: "%s"' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#links-to-internal-documentation 10 | level: error 11 | scope: raw 12 | raw: 13 | - '[^\`]\[[^\[\]]+\]\((https?:){0}[\w\/\.]*?#[^\s]*?[A-Z][^\) ]*\)[^\`]' 14 | -------------------------------------------------------------------------------- /.vale/gitlab/InternalLinkExtension.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.InternalLinkExtension 3 | # 4 | # Checks that internal links have .md extenstion and not .html extension. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Link "%s" must use the .md file extension.' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#links-to-internal-documentation 10 | level: error 11 | scope: raw 12 | raw: 13 | - '\[.+\]\((https?:){0}[\w\/\.-]+(\.html).*?\)' 14 | -------------------------------------------------------------------------------- /.vale/gitlab/InternalLinkFormat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.InternalLinkFormat 3 | # 4 | # Checks that internal link paths don't start with "./", which is not needed. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Link "%s" must not start with "./".' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#links-to-internal-documentation 10 | level: suggestion 11 | scope: raw 12 | raw: 13 | - '\[.+\]\(\.\/.+?\)' 14 | -------------------------------------------------------------------------------- /.vale/gitlab/LatinTerms.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.LatinTerms 3 | # 4 | # Checks for use of Latin terms. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: substitution 8 | message: 'Use "%s" instead of "%s", but consider rewriting the sentence.' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#usage-list 10 | level: warning 11 | nonword: true 12 | ignorecase: true 13 | swap: 14 | e\.g\.: for example 15 | e\. g\.: for example 16 | i\.e\.: that is 17 | i\. e\.: that is 18 | -------------------------------------------------------------------------------- /.vale/gitlab/MeaningfulLinkWords.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.MeaningfulLinkWords 3 | # 4 | # Checks for the presence of semantically unhelpful words in link text. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Improve SEO and accessibility by rewriting "%s" in the link text.' 9 | level: warning 10 | scope: raw 11 | ignorecase: true 12 | link: https://about.gitlab.com/handbook/communication/#writing-style-guidelines 13 | tokens: 14 | - here 15 | - this page 16 | -------------------------------------------------------------------------------- /.vale/gitlab/MergeConflictMarkers.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.MergeConflictMarkers 3 | # 4 | # Checks for the presence of merge conflict markers. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Merge conflict marker "%s" found.' 9 | link: https://docs.gitlab.com/ee/development/code_review.html#merging-a-merge-request 10 | level: error 11 | scope: raw 12 | raw: 13 | - '\n<<<<<<< .+\n|\n=======\n|\n>>>>>>> .+\n' 14 | -------------------------------------------------------------------------------- /.vale/gitlab/NonStandardQuotes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.NonStandardQuotes 3 | # 4 | # Use only standard single and double quotes, not left or right quotes. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Use standard single quotes or double quotes only. Do not use left or right quotes.' 9 | level: warning 10 | ignorecase: true 11 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html 12 | scope: raw 13 | raw: 14 | - '[‘’“”]' 15 | -------------------------------------------------------------------------------- /.vale/gitlab/OutdatedVersions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.OutdatedVersions 3 | # 4 | # Checks for references to versions of GitLab that are no longer supported. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Can this reference to "%s" be refactored?' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#gitlab-versions 10 | level: suggestion 11 | nonword: true 12 | ignorecase: true 13 | tokens: 14 | - "GitLab (v)?2." 15 | - "GitLab (v)?3." 16 | - "GitLab (v)?4." 17 | - "GitLab (v)?5." 18 | - "GitLab (v)?6." 19 | - "GitLab (v)?7." 20 | - "GitLab (v)?8." 21 | - "GitLab (v)?9." 22 | -------------------------------------------------------------------------------- /.vale/gitlab/OxfordComma.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.OxfordComma 3 | # 4 | # Checks for the lack of an Oxford comma. In some cases, will catch overly complex sentence structures with lots of commas. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Use a comma before the last "and" or "or" in a list of four or more items.' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#punctuation 10 | level: warning 11 | raw: 12 | - '(?:[\w-_` ]+,){2,}(?:[\w-_` ]+) (and |or )' 13 | -------------------------------------------------------------------------------- /.vale/gitlab/Possessive.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.Possessive 3 | # 4 | # The word GitLab should not be used in the possessive form. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: "Rewrite '%s' to not use 's." 9 | level: error 10 | ignorecase: true 11 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#trademark 12 | tokens: 13 | - GitLab's 14 | -------------------------------------------------------------------------------- /.vale/gitlab/ReadingLevel.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Suggestion: gitlab.ReadingLevel 3 | # 4 | # Checks the Flesch-Kincaid reading level. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: readability 8 | message: "Grade level (%s) is high. To lower the score, use shorter sentences and words." 9 | level: suggestion 10 | grade: 8 11 | metrics: 12 | - Flesch-Kincaid 13 | -------------------------------------------------------------------------------- /.vale/gitlab/ReferenceLinks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.ReferenceLinks 3 | # 4 | # Checks for reference-style links that should be converted to inline links. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Link "%s" must be inline.' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#basic-link-criteria 10 | level: suggestion 11 | scope: raw 12 | raw: 13 | - '\n\[[^\]]*\]: .*' 14 | -------------------------------------------------------------------------------- /.vale/gitlab/RelativeLinksDoubleSlashes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.RelativeLinksDoubleSlashes 3 | # 4 | # Checks for the presence of double slashes in relative URLs. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Relative links must not include a double slash.' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#links-to-internal-documentation 10 | level: error 11 | scope: raw 12 | raw: 13 | - '\.//' 14 | -------------------------------------------------------------------------------- /.vale/gitlab/Repetition.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.Repetition 3 | # 4 | # Checks for duplicate words, like `the the` or `and and`. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: repetition 8 | message: '"%s" is repeated.' 9 | level: error 10 | alpha: true 11 | tokens: 12 | - '[^\s]+' 13 | -------------------------------------------------------------------------------- /.vale/gitlab/SentenceLength.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.SentenceLength 3 | # 4 | # Counts words in a sentence and alerts if a sentence exceeds 25 words. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: occurrence 8 | message: 'Shorter sentences improve readability (max 25 words).' 9 | scope: sentence 10 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#language 11 | level: warning 12 | max: 25 13 | token: \b(\w+)\b 14 | -------------------------------------------------------------------------------- /.vale/gitlab/SentenceSpacing.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.SentenceSpacing 3 | # 4 | # Checks for incorrect spacing (no spaces, or more than one space) around punctuation. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: '"%s" must contain one and only one space.' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#punctuation 10 | level: error 11 | nonword: true 12 | tokens: 13 | - '[a-z][.?!,][A-Z]' 14 | - '[\w.?!,\(\)\-":] {2,}[\w.?!,\(\)\-":]' 15 | -------------------------------------------------------------------------------- /.vale/gitlab/Simplicity.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Suggestion: gitlab.Simplicity 3 | # 4 | # Checks for words implying ease of use, to avoid cognitive dissonance for frustrated users. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: existence 8 | message: 'Avoid words like "%s" that imply ease of use, because the user may find this action hard.' 9 | level: suggestion 10 | ignorecase: true 11 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#usage-list 12 | tokens: 13 | - handy 14 | - simple 15 | - simply 16 | - useful 17 | -------------------------------------------------------------------------------- /.vale/gitlab/Spelling.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.Spelling 3 | # 4 | # Checks for possible spelling mistakes in content, not code. Results from links using angle brackets () should be corrected. 5 | # 6 | # If a word is flagged as a spelling mistake incorrectly, such as a product name, 7 | # you can submit an MR to update `spelling-exceptions.txt` with the missing word. 8 | # Commands, like `git clone` must use backticks, and must not be added to the 9 | # exceptions. 10 | # 11 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 12 | extends: spelling 13 | message: 'Spelling check: "%s"?' 14 | level: warning 15 | ignore: 16 | - gitlab/spelling-exceptions.txt 17 | -------------------------------------------------------------------------------- /.vale/gitlab/SubstitutionSuggestions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Suggestion: gitlab.SubstitutionSuggestions 3 | # 4 | # Suggests better options for frequently misused terms that are often - but not always - incorrect. 5 | # SubstitutionWarning.yml and Substitutions.yml also exist. 6 | # 7 | # For a list of all options, see https://errata-ai.github.io/vale/styles/ 8 | extends: substitution 9 | message: 'Consider %s instead of "%s".' 10 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#language 11 | level: suggestion 12 | ignorecase: true 13 | swap: 14 | active user: '"billable user"' 15 | active users: '"billable users"' 16 | docs: '"documentation"' 17 | GFM: '"GitLab Flavored Markdown"' 18 | OAuth2: '"OAuth 2.0"' 19 | once that: '"after that"' 20 | once the: '"after the"' 21 | once you: '"after you"' 22 | since: '"because" or "after"' 23 | sub-group: '"subgroup"' 24 | sub-groups: '"subgroups"' 25 | within: '"in"' 26 | -------------------------------------------------------------------------------- /.vale/gitlab/SubstitutionWarning.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.SubstitutionWarning 3 | # 4 | # Checks for misused terms or common shorthand that should never be used at GitLab, but can't be flagged as errors. 5 | # Substitutions.yml and SubstitionSuggestions.yml also exist. 6 | # 7 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 8 | extends: substitution 9 | message: 'If possible, use "%s" instead of "%s".' 10 | link: https://about.gitlab.com/handbook/communication/#top-misused-terms 11 | level: warning 12 | ignorecase: true 13 | swap: 14 | code base: codebase 15 | config: configuration 16 | distro: distribution 17 | file name: filename 18 | filesystem: file system 19 | info: information 20 | repo: repository 21 | utilize: use 22 | administrator access: the Administrator role 23 | administrator permission: the Administrator role 24 | administrator permissions: the Administrator role 25 | -------------------------------------------------------------------------------- /.vale/gitlab/Substitutions.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.Substitutions 3 | # 4 | # Checks for misused terms that should never be used at GitLab. 5 | # SubstitutionWarning.yml and SubstitionSuggestions.yml also exist. 6 | # 7 | # For a list of all options, see https://docs.errata.ai/vale/styles 8 | extends: substitution 9 | message: 'Use "%s" instead of "%s".' 10 | link: https://about.gitlab.com/handbook/communication/#top-misused-terms 11 | level: error 12 | ignorecase: true 13 | swap: 14 | codequality: code quality 15 | Customer [Pp]ortal: Customers Portal 16 | frontmatter: front matter 17 | GitLabber: GitLab team member 18 | GitLabbers: GitLab team members 19 | GitLab-shell: GitLab Shell 20 | gitlab omnibus: Omnibus GitLab 21 | param: parameter 22 | params: parameters 23 | pg: PostgreSQL 24 | 'postgres$': PostgreSQL 25 | raketask: Rake task 26 | raketasks: Rake tasks 27 | rspec: RSpec 28 | self hosted: self-managed 29 | self-hosted: self-managed 30 | styleguide: style guide 31 | to login: to log in 32 | can login: can log in 33 | to log-in: to log in 34 | can log-in: can log in 35 | to signin: to sign in 36 | can signin: can sign in 37 | to sign-in: to sign in 38 | can sign-in: can sign in 39 | x509: X.509 40 | yaml: YAML 41 | developer access: the Developer role 42 | developer permission: the Developer role 43 | developer permissions: the Developer role 44 | maintainer access: the Maintainer role 45 | maintainer permission: the Maintainer role 46 | maintainer permissions: the Maintainer role 47 | owner access: the Owner role 48 | owner permission: the Owner role 49 | owner permissions: the Owner role 50 | -------------------------------------------------------------------------------- /.vale/gitlab/ToDo.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Warning: gitlab.ToDo 3 | # 4 | # You should not use "To Do", unless it refers to the UI element. 5 | # 6 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 7 | extends: substitution 8 | message: 'Use "to-do item" in most cases, or "Add a to do" if referring to the UI button.' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#feature-names 10 | level: warning 11 | ignorecase: false 12 | swap: 13 | '[Tt]o [Dd]o [Ii]tems?': to-do item 14 | '\w* [Aa] [Tt]o [Dd]o': Add a to do 15 | -------------------------------------------------------------------------------- /.vale/gitlab/VersionText.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Error: gitlab.VersionText 3 | # 4 | # Checks that version text is formatted correctly. 5 | # 6 | # Specifically looks for either of the following that is immediately followed on the next line 7 | # by content, which will break rendering: 8 | # 9 | # - `> Introduced` (version text without a link) 10 | # - `> [Introduced` (version text with a link) 11 | # 12 | # Because it excludes `-`, it doesn't look for multi-line version text, for which content 13 | # immediately on the next line is ok. However, this will often highlight where multi-line version 14 | # text is attempted without `-` characters. 15 | # 16 | # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles 17 | extends: existence 18 | message: 'This introduced-in line is not formatted correctly.' 19 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#version-text-in-the-version-history 20 | level: error 21 | scope: raw 22 | raw: 23 | - '> (- ){0}\[?Introduced.+\n[^\n`]' 24 | -------------------------------------------------------------------------------- /.vale/gitlab/Wordy.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Suggestion: gitlab.Wordy 3 | # 4 | # Suggests shorter versions of wordy phrases. 5 | # 6 | # For a list of all options, see https://docs.errata.ai/vale/styles 7 | extends: substitution 8 | message: 'Be concise: "%s" is less wordy than "%s".' 9 | link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html 10 | level: suggestion 11 | ignorecase: true 12 | swap: 13 | in order to: to 14 | -------------------------------------------------------------------------------- /.vale/vale.tmpl: -------------------------------------------------------------------------------- 1 | {{- /* Modify Vale's output https://docs.errata.ai/vale/cli#--output */ -}} 2 | 3 | {{- /* Keep track of our various counts */ -}} 4 | 5 | {{- $e := 0 -}} 6 | {{- $w := 0 -}} 7 | {{- $s := 0 -}} 8 | {{- $f := 0 -}} 9 | 10 | {{- /* Range over the linted files */ -}} 11 | 12 | {{- range .Files}} 13 | 14 | {{- $f = add1 $f -}} 15 | {{- $path := .Path | underline -}} 16 | 17 | {{- /* Range over the file's alerts */ -}} 18 | 19 | {{- range .Alerts -}} 20 | 21 | {{- $error := "" -}} 22 | {{- if eq .Severity "error" -}} 23 | {{- $error = .Severity | red -}} 24 | {{- $e = add1 $e -}} 25 | {{- else if eq .Severity "warning" -}} 26 | {{- $error = .Severity | yellow -}} 27 | {{- $w = add1 $w -}} 28 | {{- else -}} 29 | {{- $error = .Severity | blue -}} 30 | {{- $s = add1 $s -}} 31 | {{- end}} 32 | 33 | {{- /* Variables setup */ -}} 34 | 35 | {{- $path = $path -}} 36 | {{- $loc := printf "Line %d, position %d" .Line (index .Span 0) -}} 37 | {{- $check := printf "%s" .Check -}} 38 | {{- $message := printf "%s" .Message -}} 39 | {{- $link := printf "%s" .Link -}} 40 | 41 | {{- /* Output */ -}} 42 | 43 | {{ $path }}: 44 | {{ $loc }} (rule {{ $check }}) 45 | {{ $error }}: {{ $message }} 46 | More information: {{ $link }} 47 | 48 | {{end -}} 49 | {{end -}} 50 | 51 | {{- $e}} {{"errors" | red}}, {{$w}} {{"warnings" | yellow}}, and {{$s}} {{"suggestions" | blue}} found in {{$f}} {{$f | int | plural "file" "files"}}. 52 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Abouzar Parvan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /after/ftplugin/c.lua: -------------------------------------------------------------------------------- 1 | local opts = {} 2 | if lvim.builtin.cpp_programming.active then 3 | local clangd_flags = { 4 | "--background-index", 5 | "--fallback-style=google", 6 | "-j=12", 7 | "--all-scopes-completion", 8 | "--pch-storage=memory", 9 | "--clang-tidy", 10 | "--log=error", 11 | "--completion-style=detailed", 12 | "--header-insertion=iwyu", 13 | "--header-insertion-decorators", 14 | "--enable-config", 15 | "--offset-encoding=utf-16", 16 | "--ranking-model=heuristics", 17 | } 18 | 19 | local provider = "clangd" 20 | 21 | local custom_on_attach = function(client, bufnr) 22 | require("lvim.lsp").common_on_attach(client, bufnr) 23 | require("clangd_extensions.inlay_hints").setup_autocmd() 24 | require("clangd_extensions.inlay_hints").set_inlay_hints() 25 | end 26 | 27 | local status_ok, project_config = pcall(require, "rhel.clangd_wrl") 28 | if status_ok then 29 | clangd_flags = vim.tbl_deep_extend("keep", project_config, clangd_flags) 30 | end 31 | 32 | local custom_on_init = function(client, bufnr) 33 | require("lvim.lsp").common_on_init(client, bufnr) 34 | require("clangd_extensions.config").setup {} 35 | vim.cmd [[ 36 | command ClangdToggleInlayHints lua require('clangd_extensions.inlay_hints').toggle_inlay_hints() 37 | command -range ClangdAST lua require('clangd_extensions.ast').display_ast(, ) 38 | command ClangdTypeHierarchy lua require('clangd_extensions.type_hierarchy').show_hierarchy() 39 | command ClangdSymbolInfo lua require('clangd_extensions.symbol_info').show_symbol_info() 40 | command -nargs=? -complete=customlist,s:memuse_compl ClangdMemoryUsage lua require('clangd_extensions.memory_usage').show_memory_usage('' == 'expand_preamble') 41 | ]] 42 | end 43 | 44 | opts = { 45 | cmd = { provider, unpack(clangd_flags) }, 46 | on_attach = custom_on_attach, 47 | on_init = custom_on_init, 48 | } 49 | end 50 | 51 | require("lvim.lsp.manager").setup("clangd", opts) 52 | -------------------------------------------------------------------------------- /after/ftplugin/c.vim: -------------------------------------------------------------------------------- 1 | setlocal tabstop=4 2 | setlocal shiftwidth=4 3 | setlocal autoindent 4 | setlocal smarttab 5 | setlocal noexpandtab 6 | setlocal textwidth=80 7 | setlocal formatoptions=croql 8 | -------------------------------------------------------------------------------- /after/ftplugin/cmake.vim: -------------------------------------------------------------------------------- 1 | set shiftwidth=2 2 | setlocal commentstring=#%s 3 | -------------------------------------------------------------------------------- /after/ftplugin/cpp.lua: -------------------------------------------------------------------------------- 1 | c.lua -------------------------------------------------------------------------------- /after/ftplugin/cpp.vim: -------------------------------------------------------------------------------- 1 | setlocal tabstop=4 2 | setlocal shiftwidth=4 3 | setlocal commentstring=//%s 4 | -------------------------------------------------------------------------------- /after/ftplugin/crontab.vim: -------------------------------------------------------------------------------- 1 | setlocal nobackup 2 | setlocal nowritebackup 3 | -------------------------------------------------------------------------------- /after/ftplugin/make.vim: -------------------------------------------------------------------------------- 1 | setlocal noexpandtab 2 | " https://mattn.kaoriya.net/software/vim/20070821175457.htm 3 | setlocal isfname-== isfname+=32 isfname-=I isfname-=L 4 | setlocal shiftwidth=2 5 | setlocal softtabstop=2 6 | setlocal tabstop=2 -------------------------------------------------------------------------------- /after/ftplugin/qf.vim: -------------------------------------------------------------------------------- 1 | function! AdjustWindowHeight(minheight, maxheight) 2 | execute max([a:minheight, min([line('$'), a:maxheight])]) . 'wincmd _' 3 | endfunction 4 | 5 | " force quickfix to open beneath all other splits 6 | wincmd J 7 | 8 | setlocal nonumber 9 | setlocal norelativenumber 10 | setlocal nowrap 11 | setlocal signcolumn=yes 12 | setlocal colorcolumn= 13 | setlocal nobuflisted " quickfix buffers should not pop up when doing :bn or :bp 14 | call AdjustWindowHeight(7, 15) 15 | setlocal winfixheight 16 | setlocal winhighlight=Normal:PanelBackground,SignColumn:PanelBackground,EndOfBuffer:PanelBackground 17 | nnoremap H :colder 18 | nnoremap L :cnewer 19 | -------------------------------------------------------------------------------- /after/ftplugin/scheme.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=2 2 | setlocal expandtab 3 | -------------------------------------------------------------------------------- /after/ftplugin/solidity.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=4 2 | setlocal tabstop=4 3 | -------------------------------------------------------------------------------- /after/ftplugin/tex.vim: -------------------------------------------------------------------------------- 1 | setlocal conceallevel=2 2 | -------------------------------------------------------------------------------- /after/ftplugin/typescript.vim: -------------------------------------------------------------------------------- 1 | setlocal shiftwidth=4 2 | setlocal formatoptions-=o 3 | -------------------------------------------------------------------------------- /after/queries/markdown/injections.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | 3 | (fenced_code_block 4 | (info_string 5 | (language) @_lang) 6 | (#match? @_lang "shell") 7 | (code_fence_content) @injection.content 8 | (#set! injection.language "bash")) 9 | -------------------------------------------------------------------------------- /after/syntax/dap-repl.vim: -------------------------------------------------------------------------------- 1 | " Quit when a syntax file was already loaded 2 | if exists('b:current_syntax') 3 | finish 4 | endif 5 | 6 | runtime! syntax/log.vim 7 | let b:current_syntax = 'dap-repl' 8 | -------------------------------------------------------------------------------- /after/syntax/gomod.vim: -------------------------------------------------------------------------------- 1 | " gomod.vim: Vim syntax file for go.mod file 2 | " 3 | " Quit when a (custom) syntax file was already loaded 4 | if exists('b:current_syntax') 5 | finish 6 | endif 7 | 8 | syntax case match 9 | 10 | " match keywords 11 | syntax keyword gomodModule module 12 | syntax keyword gomodGo go contained 13 | syntax keyword gomodRequire require 14 | syntax keyword gomodExclude exclude 15 | syntax keyword gomodReplace replace 16 | 17 | " require, exclude, replace, and go can be also grouped into block 18 | syntax region gomodRequire start='require (' end=')' transparent contains=gomodRequire,gomodVersion 19 | syntax region gomodExclude start='exclude (' end=')' transparent contains=gomodExclude,gomodVersion 20 | syntax region gomodReplace start='replace (' end=')' transparent contains=gomodReplace,gomodVersion 21 | syntax match gomodGo '^go .*$' transparent contains=gomodGo,gomodGoVersion 22 | 23 | " set highlights 24 | highlight default link gomodModule Keyword 25 | highlight default link gomodGo Keyword 26 | highlight default link gomodRequire Keyword 27 | highlight default link gomodExclude Keyword 28 | highlight default link gomodReplace Keyword 29 | 30 | " comments are always in form of // ... 31 | syntax region gomodComment start="//" end="$" contains=@Spell 32 | highlight default link gomodComment Comment 33 | 34 | " make sure quoted import paths are higlighted 35 | syntax region gomodString start=+"+ skip=+\\\\\|\\"+ end=+"+ 36 | highlight default link gomodString String 37 | 38 | " replace operator is in the form of '=>' 39 | syntax match gomodReplaceOperator "\v\=\>" 40 | highlight default link gomodReplaceOperator Operator 41 | 42 | " match go versions 43 | syntax match gomodGoVersion "1\.\d\+" contained 44 | highlight default link gomodGoVersion Identifier 45 | 46 | 47 | " highlight versions: 48 | " * vX.Y.Z-pre 49 | " * vX.Y.Z 50 | " * vX.0.0-yyyyymmddhhmmss-abcdefabcdef 51 | " * vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefabcdef 52 | " * vX.Y.(Z+1)-0.yyyymmddhhss-abcdefabcdef 53 | " see https://godoc.org/golang.org/x/tools/internal/semver for more 54 | " information about how semantic versions are parsed and 55 | " https://golang.org/cmd/go/ for how pseudo-versions and +incompatible 56 | " are applied. 57 | 58 | 59 | " match vX.Y.Z and their prereleases 60 | syntax match gomodVersion "v\d\+\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?" 61 | " ^--- version ---^^------------ pre-release ---------------------^^--------------- metadata ---------------------^ 62 | " ^--------------------------------------- semantic version -------------------------------------------------------^ 63 | 64 | " match pseudo versions 65 | " without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef) 66 | syntax match gomodVersion "v\d\+\.0\.0-\d\{14\}-\x\+" 67 | " when most recent version before target is a pre-release 68 | syntax match gomodVersion "v\d\+\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\+" 69 | " ^--- version ---^^--- ------ pre-release -----------------^^--------------- metadata ---------------------^ 70 | " ^------------------------------------- semantic version --------------------------------------------------^ 71 | " most recent version before the target is X.Y.Z 72 | syntax match gomodVersion "v\d\+\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\+" 73 | " ^--- version ---^^--------------- metadata ---------------------^ 74 | 75 | " match incompatible vX.Y.Z and their prereleases 76 | syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?+incompatible" 77 | " ^------- version -------^^------------- pre-release ---------------------^^--------------- metadata ---------------------^ 78 | " ^------------------------------------------- semantic version -----------------------------------------------------------^ 79 | 80 | " match incompatible pseudo versions 81 | " incompatible without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef) 82 | syntax match gomodVersion "v[2-9]\{1}\d*\.0\.0-\d\{14\}-\x\++incompatible" 83 | " when most recent version before target is a pre-release 84 | syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\++incompatible" 85 | " ^------- version -------^^---------- pre-release -----------------^^--------------- metadata ---------------------^ 86 | " ^---------------------------------------- semantic version ------------------------------------------------------^ 87 | " most recent version before the target is X.Y.Z 88 | syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\++incompatible" 89 | " ^------- version -------^^---------------- metadata ---------------------^ 90 | highlight default link gomodVersion Identifier 91 | 92 | let b:current_syntax = "gomod" 93 | -------------------------------------------------------------------------------- /after/syntax/hcl.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: HashiCorp Configuration Language (HCL) 3 | " Maintainer: Jussi Virtanen 4 | " Repository: https://github.com/jvirtanen/vim-hcl 5 | " License: Vim 6 | 7 | if exists('b:current_syntax') 8 | finish 9 | end 10 | 11 | syn match hclVariable /\<[A-Za-z0-9_.\[\]*]\+\>/ 12 | 13 | syn match hclParenthesis /(/ 14 | syn match hclFunction /\w\+(/ contains=hclParenthesis 15 | 16 | syn keyword hclKeyword for in if 17 | 18 | syn region hclString start=/"/ end=/"/ contains=hclEscape,hclInterpolation 19 | syn region hclString start=/<<-\?\z([A-Z]\+\)/ end=/^\s*\z1/ contains=hclEscape,hclInterpolation 20 | 21 | syn match hclEscape /\\n/ 22 | syn match hclEscape /\\r/ 23 | syn match hclEscape /\\t/ 24 | syn match hclEscape /\\"/ 25 | syn match hclEscape /\\\\/ 26 | syn match hclEscape /\\u\x\{4\}/ 27 | syn match hclEscape /\\u\x\{8\}/ 28 | 29 | syn match hclNumber /\<\d\+\%([eE][+-]\?\d\+\)\?\>/ 30 | syn match hclNumber /\<\d*\.\d\+\%([eE][+-]\?\d\+\)\?\>/ 31 | syn match hclNumber /\<0[xX]\x\+\>/ 32 | 33 | syn keyword hclConstant true false null 34 | 35 | syn region hclInterpolation start=/\${/ end=/}/ contained contains=hclInterpolation 36 | 37 | syn region hclComment start=/\/\// end=/$/ contains=hclTodo 38 | syn region hclComment start=/\#/ end=/$/ contains=hclTodo 39 | syn region hclComment start=/\/\*/ end=/\*\// contains=hclTodo 40 | 41 | syn match hclAttributeName /\w\+/ contained 42 | syn match hclAttribute /^[^=]\+=/ contains=hclAttributeName,hclComment,hclString 43 | 44 | syn match hclBlockName /\w\+/ contained 45 | syn match hclBlock /^[^=]\+{/ contains=hclBlockName,hclComment,hclString 46 | 47 | syn keyword hclTodo TODO FIXME XXX DEBUG NOTE contained 48 | 49 | hi def link hclVariable PreProc 50 | hi def link hclFunction Function 51 | hi def link hclKeyword Keyword 52 | hi def link hclString String 53 | hi def link hclEscape Special 54 | hi def link hclNumber Number 55 | hi def link hclConstant Constant 56 | hi def link hclInterpolation PreProc 57 | hi def link hclComment Comment 58 | hi def link hclTodo Todo 59 | hi def link hclBlockName Structure 60 | 61 | let b:current_syntax = 'hcl' 62 | -------------------------------------------------------------------------------- /after/syntax/log.vim: -------------------------------------------------------------------------------- 1 | " Operators 2 | "--------------------------------------------------------------------------- 3 | syn match logOperator display '[;,\?\:\.\<=\>\~\/\@\&\!$\%\&\+\-\|\^(){}\*#]' 4 | syn match logBrackets display '[\[\]]' 5 | syn match logEmptyLines display '-\{3,}' 6 | syn match logEmptyLines display '\*\{3,}' 7 | syn match logEmptyLines display '=\{3,}' 8 | syn match logEmptyLines display '- - ' 9 | 10 | 11 | " Constants 12 | "--------------------------------------------------------------------------- 13 | syn match logNumber '\<-\?\d\+\>' 14 | syn match logHexNumber '\<0[xX]\x\+\>' 15 | syn match logHexNumber '\<\d\x\+\>' 16 | syn match logBinaryNumber '\<0[bB][01]\+\>' 17 | syn match logFloatNumber '\<\d.\d\+[eE]\?\>' 18 | 19 | syn keyword logBoolean TRUE FALSE True False true false 20 | syn keyword logNull NULL Null null 21 | 22 | syn region logString start=/"/ end=/"/ end=/$/ skip=/\\./ 23 | " Quoted strings, but no match on quotes like "don't", "plurals' elements" 24 | syn region logString start=/'\(s \|t \| \w\)\@!/ end=/'/ end=/$/ end=/s / skip=/\\./ 25 | 26 | 27 | " Dates and Times 28 | "--------------------------------------------------------------------------- 29 | " Matches 2018-03-12T or 12/03/2018 or 12/Mar/2018 30 | syn match logDate '\d\{2,4}[-\/]\(\d\{2}\|Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)[-\/]\d\{2,4}T\?' 31 | " Matches 8 digit numbers at start of line starting with 20 32 | syn match logDate '^20\d\{6}' 33 | " Matches Fri Jan 09 or Feb 11 or Apr 3 34 | syn match logDate '\(\(Mon\|Tue\|Wed\|Thu\|Fri\|Sat\|Sun\) \)\?\(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\) [0-9 ]\d' 35 | 36 | " Matches 12:09:38 or 00:03:38.129Z or 01:32:12.102938 +0700 37 | syn match logTime '\d\{2}:\d\{2}:\d\{2}\(\.\d\{2,6}\)\?\(\s\?[-+]\d\{2,4}\|Z\)\?\>' nextgroup=logTimeZone,logSysColumns skipwhite 38 | 39 | " Follows logTime, matches UTC or PDT 2019 or 2019 EDT 40 | syn match logTimeZone '[A-Z]\{2,5}\>\( \d\{4}\)\?' contained 41 | syn match logTimeZone '\d\{4} [A-Z]\{2,5}\>' contained 42 | 43 | 44 | " Entities 45 | "--------------------------------------------------------------------------- 46 | syn match logUrl 'http[s]\?:\/\/[^\n|,; '"]\+' 47 | syn match logDomain /\v(^|\s)(\w|-)+(\.(\w|-)+)+\s/ 48 | syn match logUUID '\w\{8}-\w\{4}-\w\{4}-\w\{4}-\w\{12}' 49 | syn match logMD5 '\<[a-z0-9]\{32}\>' 50 | syn match logIPV4 '\<\d\{1,3}\(\.\d\{1,3}\)\{3}\>' 51 | syn match logIPV6 '\<\x\{1,4}\(:\x\{1,4}\)\{7}\>' 52 | syn match logMacAddress '\<\x\{2}\(:\x\{2}\)\{5}' 53 | syn match logFilePath '\<\w:\\[^\n|,; ()'"\]{}]\+' 54 | syn match logFilePath '[^a-zA-Z0-9"']\@<=\/\w[^\n|,; ()'"\]{}]\+' 55 | 56 | 57 | " Syslog Columns 58 | "--------------------------------------------------------------------------- 59 | " Syslog hostname, program and process number columns 60 | syn match logSysColumns '\w\(\w\|\.\|-\)\+ \(\w\|\.\|-\)\+\(\[\d\+\]\)\?:' contains=logOperator,logSysProcess contained 61 | syn match logSysProcess '\(\w\|\.\|-\)\+\(\[\d\+\]\)\?:' contains=logOperator,logNumber,logBrackets contained 62 | 63 | 64 | " XML Tags 65 | "--------------------------------------------------------------------------- 66 | " Simplified matches, not accurate with the spec to avoid false positives 67 | syn match logXmlHeader // contains=logString,logXmlAttribute,logXmlNamespace 68 | syn match logXmlDoctype /]*>/ contains=logString,logXmlAttribute,logXmlNamespace 69 | syn match logXmlTag /<\/\?\(\(\w\|-\)\+:\)\?\(\w\|-\)\+\(\(\n\|\s\)\+\(\(\w\|-\)\+:\)\?\(\w\|-\)\+\(="[^"]*"\|='[^']*'\)\?\)*\s*\/\?>/ contains=logString,logXmlAttribute,logXmlNamespace 70 | syn match logXmlAttribute contained "\w\+=" contains=logOperator 71 | syn match logXmlAttribute contained "\(\n\|\s\)\(\(\w\|-\)\+:\)\?\(\w\|-\)\+\(=\)\?" contains=logXmlNamespace,logOperator 72 | syn match logXmlNamespace contained "\(\w\|-\)\+:" contains=logOperator 73 | syn region logXmlComment start=// 74 | syn match logXmlCData // 75 | syn match logXmlEntity /\&\w\+;/ 76 | 77 | 78 | " Levels 79 | "--------------------------------------------------------------------------- 80 | syn keyword logLevelEmergency EMERGENCY EMERG 81 | syn keyword logLevelAlert ALERT 82 | syn keyword logLevelCritical CRITICAL CRIT FATAL 83 | syn keyword logLevelError ERROR ERR FAILURE SEVERE 84 | syn keyword logLevelWarning WARNING WARN 85 | syn keyword logLevelNotice NOTICE 86 | syn keyword logLevelInfo INFO 87 | syn keyword logLevelDebug DEBUG FINE 88 | syn keyword logLevelTrace TRACE FINER FINEST 89 | 90 | 91 | " Highlight links 92 | "--------------------------------------------------------------------------- 93 | hi def link logNumber Number 94 | hi def link logHexNumber Number 95 | hi def link logBinaryNumber Number 96 | hi def link logFloatNumber Float 97 | hi def link logBoolean Boolean 98 | hi def link logNull Constant 99 | hi def link logString String 100 | 101 | hi def link logDate Identifier 102 | hi def link logTime Function 103 | hi def link logTimeZone Identifier 104 | 105 | hi def link logUrl Underlined 106 | hi def link logDomain Label 107 | hi def link logUUID Label 108 | hi def link logMD5 Label 109 | hi def link logIPV4 Label 110 | hi def link logIPV6 ErrorMsg 111 | hi def link logMacAddress Label 112 | hi def link logFilePath Conditional 113 | 114 | hi def link logSysColumns Conditional 115 | hi def link logSysProcess Include 116 | 117 | hi def link logXmlHeader Function 118 | hi def link logXmlDoctype Function 119 | hi def link logXmlTag Identifier 120 | hi def link logXmlAttribute Type 121 | hi def link logXmlNamespace Include 122 | hi def link logXmlComment Comment 123 | hi def link logXmlCData String 124 | hi def link logXmlEntity Special 125 | 126 | hi def link logOperator Operator 127 | hi def link logBrackets Comment 128 | hi def link logEmptyLines Comment 129 | 130 | hi def link logLevelEmergency ErrorMsg 131 | hi def link logLevelAlert ErrorMsg 132 | hi def link logLevelCritical ErrorMsg 133 | hi def link logLevelError ErrorMsg 134 | hi def link logLevelWarning WarningMsg 135 | hi def link logLevelNotice Character 136 | hi def link logLevelInfo Repeat 137 | hi def link logLevelDebug Debug 138 | hi def link logLevelTrace Comment 139 | -------------------------------------------------------------------------------- /after/syntax/lua.vim: -------------------------------------------------------------------------------- 1 | 2 | syntax keyword luaMyKeyword 3 | \ self 4 | 5 | syntax keyword luaKeyword 6 | \ _VERSION 7 | \ dofile 8 | \ getfenv 9 | \ getmetatable 10 | \ ipairs 11 | \ load 12 | \ loadfile 13 | \ loadstring 14 | \ next 15 | \ pairs 16 | \ print 17 | \ rawequal 18 | \ rawget 19 | \ rawlen 20 | \ rawset 21 | \ select 22 | \ setfenv 23 | \ setmetatable 24 | \ tonumber 25 | \ tostring 26 | \ type 27 | \ unpack 28 | 29 | syntax match luaSpecialFunctions /table\.concat/ 30 | syntax match luaSpecialFunctions /table\.foreach/ 31 | syntax match luaSpecialFunctions /table\.foreachi/ 32 | syntax match luaSpecialFunctions /table\.sort/ 33 | syntax match luaSpecialFunctions /table\.insert/ 34 | syntax match luaSpecialFunctions /table\.remove/ 35 | 36 | if v:false 37 | syntax match luaSpecialFunctions /string\.byte/ 38 | syntax match luaSpecialFunctions /string\.char/ 39 | syntax match luaSpecialFunctions /string\.dump/ 40 | syntax match luaSpecialFunctions /string\.find/ 41 | syntax match luaSpecialFunctions /string\.format/ 42 | syntax match luaSpecialFunctions /string\.gmatch/ 43 | syntax match luaSpecialFunctions /string\.gsub/ 44 | syntax match luaSpecialFunctions /string\.len/ 45 | syntax match luaSpecialFunctions /string\.lower/ 46 | syntax match luaSpecialFunctions /string\.upper/ 47 | syntax match luaSpecialFunctions /string\.match/ 48 | syntax match luaSpecialFunctions /string\.rep/ 49 | syntax match luaSpecialFunctions /string\.reverse/ 50 | syntax match luaSpecialFunctions /string\.sub/ 51 | endif 52 | 53 | syntax keyword luaMetatableEvents 54 | \ __index 55 | \ __newindex 56 | \ __mode 57 | \ __call 58 | \ __metatable 59 | \ __tostring 60 | \ __len 61 | \ __pairs 62 | \ __ipairs 63 | \ __gc 64 | 65 | syntax keyword luaMetatableArithmetic 66 | \ __unm 67 | \ __add 68 | \ __sub 69 | \ __mul 70 | \ __div 71 | \ __mod 72 | \ __div 73 | \ __idiv 74 | \ __mod 75 | \ __pow 76 | \ __concat 77 | 78 | syntax keyword luaMetatableEquivalence 79 | \ __eq 80 | \ __lt 81 | \ __le 82 | 83 | syntax match luaFunctionCall display /\<\(function\)\@!\w\+(/he=e-1 84 | 85 | -------------------------------------------------------------------------------- /after/syntax/make.vim: -------------------------------------------------------------------------------- 1 | syn match makePreCondit "^\s*\(ifeq\>\|else\>\|endif\>\|ifneq\>\|ifdef\>\|ifndef\>\)" 2 | syn match makeIdent "^\s*[^:#= \t]*\s*[:+?!*]="me=e-2 3 | syn match makeIdent "^\s*[^:#= \t]*\s*="me=e-1 4 | -------------------------------------------------------------------------------- /after/syntax/sh.vim: -------------------------------------------------------------------------------- 1 | " Shebang 2 | syn match shShebang "^#!.*$" containedin=shComment 3 | 4 | " Operators 5 | syn match shOperator '||' 6 | syn match shOperator '&&' 7 | 8 | " Match semicolons as Delimiter rather than Operator 9 | syn match shSemicolon ';' containedin=shOperator,zshOperator 10 | 11 | " Highlight braces, brackets and parens as Delimiters in zsh 12 | syn match zshDelim '\v(\(|\))' containedin=zshParentheses 13 | syn match zshDelim '\v(\{|\})' containedin=zshBraces 14 | syn match zshDelim '\v(\[|\])' containedin=zshParentheses 15 | 16 | " Match command flags in zsh 17 | syn match zshFlag "\v<-\w+" containedin=zshBrackets,zshParentheses 18 | 19 | " Special files as Constants 20 | syn match Constant "\v/dev/\w+" 21 | \ containedin=shFunctionOne,shIf,shCmdParenRegion,shCommandSub 22 | 23 | " Common commands 24 | let commands = [ 'arch', 'awk', 'b2sum', 'base32', 'base64', 'basename', 'basenc', 'bash', 'brew', 'cat', 'chcon', 'chgrp', 'chown', 'chroot', 'cksum', 'comm', 'cp', 'csplit', 'curl', 'cut', 'date', 'dd', 'defaults', 'df', 'dir', 'dircolors', 'dirname', 'ed', 'env', 'expand', 'factor', 'fmt', 'fold', 'git', 'grep', 'groups', 'head', 'hexdump', 'hostid', 'hostname', 'hugo', 'id', 'install', 'join', 'killall', 'link', 'ln', 'logname', 'md5sum', 'mkdir', 'mkfifo', 'mknod', 'mktemp', 'nice', 'nl', 'nohup', 'npm', 'nproc', 'numfmt', 'od', 'open', 'paste', 'pathchk', 'pr', 'printenv', 'printf', 'ptx', 'readlink', 'realpath', 'rg', 'runcon', 'scutil', 'sed', 'seq', 'sha1sum', 'sha2', 'shred', 'shuf', 'split', 'stat', 'stdbuf', 'stty', 'sudo', 'sum', 'sync', 'tac', 'tee', 'terminfo', 'timeout', 'tmux', 'top', 'touch', 'tput', 'tr', 'truncate', 'tsort', 'tty', 'uname', 'unexpand', 'uniq', 'unlink', 'uptime', 'users', 'vdir', 'vim', 'wc', 'who', 'whoami', 'yabai', 'yes' ] 25 | 26 | for i in commands 27 | execute 'syn match shStatement "\v(\w|-)@ 4 | " Last Change: $Date: $ 5 | " 6 | " $Id: $ 7 | " 8 | " Licensed to the Apache Software Foundation (ASF) under one 9 | " or more contributor license agreements. See the NOTICE file 10 | " distributed with this work for additional information 11 | " regarding copyright ownership. The ASF licenses this file 12 | " to you under the Apache License, Version 2.0 (the 13 | " "License"); you may not use this file except in compliance 14 | " with the License. You may obtain a copy of the License at 15 | " 16 | " http://www.apache.org/licenses/LICENSE-2.0 17 | " 18 | " Unless required by applicable law or agreed to in writing, 19 | " software distributed under the License is distributed on an 20 | " "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 21 | " KIND, either express or implied. See the License for the 22 | " specific language governing permissions and limitations 23 | " under the License. 24 | " 25 | 26 | if version < 600 27 | syntax clear 28 | elseif exists("b:current_syntax") 29 | finish 30 | endif 31 | 32 | " Todo 33 | syn keyword thriftTodo TODO todo FIXME fixme XXX xxx contained 34 | 35 | " Comments 36 | syn match thriftComment "#.*" contains=thriftTodo,@Spell 37 | syn region thriftComment start="/\*" end="\*/" contains=thriftTodo,@Spell 38 | syn match thriftComment "//.\{-}\(?>\|$\)\@=" 39 | 40 | " String 41 | syn region thriftStringDouble matchgroup=None start=+"+ end=+"+ 42 | 43 | " Number 44 | syn match thriftNumber "-\=\<\d\+\>" contained 45 | 46 | " Keywords 47 | syn keyword thriftStatement namespace 48 | syn keyword thriftInclude include 49 | syn keyword thriftKeyword xsd_all xsd_optional xsd_nillable xsd_attrs 50 | syn keyword thriftKeyword cpp_include cpp_type const optional required 51 | syn keyword thriftStatement throws typedef 52 | syn keyword thriftBasicTypes void bool byte string binary 53 | syn keyword thriftBasicTypes i16 i32 i64 double 54 | syn keyword thriftType map list set 55 | syn keyword thriftClass union struct exception enum 56 | syn region thriftString start=+"+ end=+"+ 57 | 58 | " Special 59 | syn match thriftNumber "\d\+:" 60 | 61 | " Structure 62 | syn keyword thriftStructure service oneway extends 63 | "async" { return tok_async; } 64 | "exception" { return tok_xception; } 65 | "extends" { return tok_extends; } 66 | "throws" { return tok_throws; } 67 | "service" { return tok_service; } 68 | "enum" { return tok_enum; } 69 | "const" { return tok_const; } 70 | 71 | if version >= 508 || !exists("did_thrift_syn_inits") 72 | if version < 508 73 | let did_thrift_syn_inits = 1 74 | command! -nargs=+ HiLink hi link 75 | else 76 | command! -nargs=+ HiLink hi def link 77 | endif 78 | 79 | HiLink thriftComment Comment 80 | HiLink thriftKeyword Special 81 | HiLink thriftBasicTypes Type 82 | HiLink thriftType Type 83 | HiLink thriftStructure StorageClass 84 | HiLink thriftTodo Todo 85 | HiLink thriftString String 86 | HiLink thriftNumber Number 87 | HiLink thriftSpecial Special 88 | HiLink thriftStructure Structure 89 | HiLink thriftStatement Statement 90 | HiLink thriftInclude Include 91 | HiLink thriftClass Type 92 | HiLink thriftString String 93 | 94 | delcommand HiLink 95 | endif 96 | 97 | let b:current_syntax = "thrift" 98 | 99 | -------------------------------------------------------------------------------- /after/syntax/vimwiki.vim: -------------------------------------------------------------------------------- 1 | syntax match VimwikiListTodo '\v(\s+)?(-|\*)\s\[-\]'hs=e-4 conceal cchar=󰄱 2 | syntax match VimwikiListTodo '\v(\s+)?(-|\*)\s\[X\]'hs=e-4 conceal cchar=󰄵 nextgroup=adda skipwhite 3 | syntax match VimwikiListTodo '\v(\s+)?(-|\*)\s\[S\]'hs=e-4 conceal cchar=󰄵 nextgroup=veta skipwhite 4 | syntax match VimwikiListTodo '\v(\s+)?(-|\*)\s\[\.\]'hs=e-4 conceal cchar=󰄱 5 | syntax match VimwikiListTodo '\v(\s+)?(-|\*)\s\[\s\]'hs=e-4 conceal cchar=󰄱 6 | syntax match VimwikiListTodo '\v(\s+)?(-|\*)\s\[o\]'hs=e-4 conceal cchar=󰄱 7 | syntax match VimwikiListTodo '\v(\s+)?(-|\*)\s\[O\]'hs=e-4 conceal cchar=󰄵 8 | 9 | syntax match adda '\S.*\ze\s\s[^#]*' contained 10 | syntax match veta '\S.*\ze\s\s[^#]*' contained 11 | 12 | hi adda gui=strikethrough 13 | hi veta guifg=#ffffff 14 | 15 | "syntax match TaskWikiTaskCompletedText containedin=TaskWikiTask contained contains=@TaskWikiTaskContains /\s*\*\s\[X\]\zs.*\ze\s\s[^#]*/ 16 | 17 | "hi def link VimwikiListTodo Todo 18 | 19 | "hi TaskWikiTaskCompletedCheck guifg=#00ff00 20 | 21 | highlight clear Conceal 22 | highlight link Conceal VimwikiListTodo 23 | -------------------------------------------------------------------------------- /ftdetect/term.vim: -------------------------------------------------------------------------------- 1 | " I want the filetype "term" for terminal windows 2 | au TermOpen term://* set filetype=term 3 | -------------------------------------------------------------------------------- /ftplugin/dap-repl.vim: -------------------------------------------------------------------------------- 1 | " Add autocompletion 2 | lua require('dap.ext.autocompl').attach() 3 | 4 | function! s:adjust_height(minheight, maxheight) 5 | exe max([min([line("$"), a:maxheight]), a:minheight]) . 'wincmd _' 6 | endfunction 7 | 8 | setlocal nobuflisted " dap repl buffers should not pop up when doing :bn or :bp 9 | call s:adjust_height(10, 15) 10 | 11 | setlocal winfixheight 12 | setlocal signcolumn=yes 13 | setlocal colorcolumn= 14 | -------------------------------------------------------------------------------- /ftplugin/dockerfile.lua: -------------------------------------------------------------------------------- 1 | local opts = { 2 | root_dir = function(fname) 3 | return require("lspconfig").util.root_pattern ".git"(fname) or require("lspconfig").util.path.dirname(fname) 4 | end, 5 | } 6 | 7 | require("lvim.lsp.manager").setup("dockerls", opts) 8 | -------------------------------------------------------------------------------- /ftplugin/go.lua: -------------------------------------------------------------------------------- 1 | local opts = { 2 | settings = { 3 | gopls = { 4 | gofumpt = true, -- A stricter gofmt 5 | codelenses = { 6 | gc_details = true, -- Toggle the calculation of gc annotations 7 | generate = true, -- Runs go generate for a given directory 8 | regenerate_cgo = true, -- Regenerates cgo definitions 9 | test = true, 10 | tidy = true, -- Runs go mod tidy for a module 11 | upgrade_dependency = true, -- Upgrades a dependency in the go.mod file for a module 12 | vendor = true, -- Runs go mod vendor for a module 13 | }, 14 | hints = { 15 | assignVariableTypes = true, 16 | compositeLiteralFields = true, 17 | compositeLiteralTypes = true, 18 | constantValues = true, 19 | functionTypeParameters = true, 20 | parameterNames = true, 21 | rangeVariableTypes = true, 22 | }, 23 | diagnosticsDelay = "300ms", 24 | symbolMatcher = "fuzzy", 25 | completeUnimported = true, 26 | staticcheck = true, 27 | matcher = "Fuzzy", 28 | usePlaceholders = true, -- enables placeholders for function parameters or struct fields in completion responses 29 | analyses = { 30 | fieldalignment = true, -- find structs that would use less memory if their fields were sorted 31 | nilness = true, -- check for redundant or impossible nil comparisons 32 | shadow = true, -- check for possible unintended shadowing of variables 33 | unusedparams = true, -- check for unused parameters of functions 34 | unusedwrite = true, -- checks for unused writes, an instances of writes to struct fields and arrays that are never read 35 | }, 36 | }, 37 | }, 38 | on_attach = function(client, bufnr) 39 | require("lvim.lsp").common_on_attach(client, bufnr) 40 | local _, _ = pcall(vim.lsp.codelens.refresh) 41 | end, 42 | } 43 | 44 | require("lvim.lsp.manager").setup("gopls", opts) 45 | -------------------------------------------------------------------------------- /ftplugin/lua.lua: -------------------------------------------------------------------------------- 1 | local lvim_lsp_utils = require "lvim.lsp.utils" 2 | if lvim_lsp_utils.is_client_active "lua_ls" then 3 | return 4 | end 5 | 6 | local lvim_lsp = require "lvim.lsp" 7 | local default_workspace = { 8 | library = { 9 | vim.fn.expand "$VIMRUNTIME", 10 | get_lvim_base_dir(), 11 | -- require("neodev.config").types(), 12 | "${3rd}/busted/library", 13 | "${3rd}/luassert/library", 14 | "${3rd}/luv/library", 15 | }, 16 | 17 | maxPreload = 5000, 18 | preloadFileSize = 10000, 19 | } 20 | local opts = { 21 | settings = { 22 | Lua = { 23 | telemetry = { enable = false }, 24 | runtime = { 25 | version = "LuaJIT", 26 | special = { 27 | reload = "require", 28 | }, 29 | }, 30 | diagnostics = { 31 | globals = { "vim", "lvim", "reload" }, 32 | }, 33 | workspace = default_workspace, 34 | }, 35 | }, 36 | on_attach = lvim_lsp.common_on_attach, 37 | on_init = lvim_lsp.common_on_init, 38 | on_exit = lvim_lsp.common_on_exit, 39 | capabilities = lvim_lsp.common_capabilities(), 40 | } 41 | -- require("lvim.lsp.manager").setup("lua_ls", opts) 42 | vim.schedule(function() 43 | require("lspconfig").lua_ls.setup(opts) 44 | local bufnr = vim.api.nvim_get_current_buf() 45 | require("lspconfig").lua_ls.manager:try_add_wrapper(bufnr) 46 | end) 47 | -------------------------------------------------------------------------------- /ftplugin/python.lua: -------------------------------------------------------------------------------- 1 | local opts = { 2 | root_dir = function(fname) 3 | local util = require "lspconfig.util" 4 | local root_files = { 5 | "pyproject.toml", 6 | "setup.py", 7 | "setup.cfg", 8 | "requirements.txt", 9 | "Pipfile", 10 | "manage.py", 11 | "pyrightconfig.json", 12 | } 13 | return util.root_pattern(unpack(root_files))(fname) or util.root_pattern ".git"(fname) or util.path.dirname(fname) 14 | end, 15 | settings = { 16 | pyright = { 17 | disableLanguageServices = false, 18 | disableOrganizeImports = false, 19 | }, 20 | python = { 21 | analysis = { 22 | autoSearchPaths = true, 23 | diagnosticMode = "workspace", 24 | useLibraryCodeForTypes = true, 25 | }, 26 | }, 27 | }, 28 | single_file_support = true, 29 | } 30 | 31 | require("lvim.lsp.manager").setup("pyright", opts) 32 | -------------------------------------------------------------------------------- /ftplugin/tex.lua: -------------------------------------------------------------------------------- 1 | local user_tex = require("user.tex").config() 2 | 3 | local opts = user_tex 4 | 5 | require("lvim.lsp.manager").setup("texlab", opts) 6 | -------------------------------------------------------------------------------- /ftplugin/toml.lua: -------------------------------------------------------------------------------- 1 | local opts = {} 2 | 3 | require("lvim.lsp.manager").setup("taplo", opts) 4 | 5 | local whk_status, whk = pcall(require, "which-key") 6 | if not whk_status then 7 | return 8 | end 9 | whk.register { 10 | ["c"] = { 11 | name = "+crates", 12 | t = { "lua require('crates').toggle()", "Toggle" }, 13 | r = { "lua require('crates').reload()", "Reload" }, 14 | v = { "lua require('crates').show_versions_popup()", "Show versions" }, 15 | f = { "lua require('crates').show_features_popup()", "Show features" }, 16 | u = { "lua require('crates').update_crate()", "Update crate" }, 17 | a = { "lua require('crates').update_all_crates()", "Update all crates" }, 18 | U = { "lua require('crates').upgrade_crate()", "Upgrade crate" }, 19 | A = { "lua require('crates').upgrade_all_crates()", "Upgrade all crates" }, 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /ftplugin/yaml.lua: -------------------------------------------------------------------------------- 1 | local opts = { 2 | settings = { 3 | yaml = { 4 | hover = true, 5 | completion = true, 6 | validate = true, 7 | schemaStore = { 8 | enable = true, 9 | url = "https://www.schemastore.org/api/json/catalog.json", 10 | }, 11 | schemas = { 12 | kubernetes = { 13 | "daemon.{yml,yaml}", 14 | "manager.{yml,yaml}", 15 | "restapi.{yml,yaml}", 16 | "kubectl-edit*.yaml", 17 | }, 18 | ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master/configmap.json"] = "*onfigma*.{yml,yaml}", 19 | ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master/deployment.json"] = "*eployment*.{yml,yaml}", 20 | ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master/service.json"] = "*ervic*.{yml,yaml}", 21 | ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master/ingress.json"] = "*ngres*.{yml,yaml}", 22 | ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master/secret.json"] = "*ecre*.{yml,yaml}", 23 | }, 24 | }, 25 | }, 26 | } 27 | 28 | require("lvim.lsp.manager").setup("yamlls", opts) 29 | -------------------------------------------------------------------------------- /lsp-settings/gopls.json: -------------------------------------------------------------------------------- 1 | { 2 | "go.lintTool": "golangci-lint", 3 | "go.formatTool": "goimports" 4 | } 5 | -------------------------------------------------------------------------------- /lsp-settings/jdtls.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.format.enabled": true 3 | } 4 | -------------------------------------------------------------------------------- /lsp-settings/lua_ls.json: -------------------------------------------------------------------------------- 1 | { 2 | "Lua.hint.enable": true, 3 | "Lua.hint.paramName": "All", 4 | "Lua.hint.paramType": false, 5 | "Lua.hint.setType": false, 6 | "Lua.hint.arrayIndex": "Disable" 7 | } 8 | -------------------------------------------------------------------------------- /lsp-settings/pyright.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.analysis.typeCheckingMode": "off" 3 | } 4 | -------------------------------------------------------------------------------- /lsp-settings/rust_analyzer.json: -------------------------------------------------------------------------------- 1 | { 2 | "rust-analyzer.checkOnSave.enable": true, 3 | "rust-analyzer.checkOnSave.command": "clippy", 4 | "rust-analyzer.callInfo.full": true, 5 | "rust-analyzer.lens.enable": true, 6 | "rust-analyzer.inlayHints.enable": true, 7 | "rust-analyzer.inlayHints.typeHints": true, 8 | "rust-analyzer.inlayHints.parameterHints": true, 9 | "rust-analyzer.lens.references": true, 10 | "rust-analyzer.lens.implementations": true, 11 | "rust-analyzer.lens.enumVariantReferences": true, 12 | "rust-analyzer.lens.methodReferences": true, 13 | "rust-analyzer.cargo.autoreload": true, 14 | "rust-analyzer.hoverActions.enable": true 15 | } 16 | -------------------------------------------------------------------------------- /lua/lualine/themes/tokyonight.lua: -------------------------------------------------------------------------------- 1 | local colors = require("tokyonight.colors").setup({ transform = true }) 2 | local config = require("tokyonight.config").options 3 | local bg_statusline = "#1a1b26" 4 | 5 | local tokyonight = {} 6 | 7 | tokyonight.normal = { 8 | a = { bg = colors.blue, fg = colors.black }, 9 | b = { bg = colors.fg_gutter, fg = colors.blue }, 10 | c = { bg = bg_statusline, fg = colors.fg_sidebar }, 11 | } 12 | 13 | tokyonight.insert = { 14 | a = { bg = colors.green, fg = colors.black }, 15 | b = { bg = colors.fg_gutter, fg = colors.green }, 16 | } 17 | 18 | tokyonight.command = { 19 | a = { bg = colors.yellow, fg = colors.black }, 20 | b = { bg = colors.fg_gutter, fg = colors.yellow }, 21 | } 22 | 23 | tokyonight.visual = { 24 | a = { bg = colors.magenta, fg = colors.black }, 25 | b = { bg = colors.fg_gutter, fg = colors.magenta }, 26 | } 27 | 28 | tokyonight.replace = { 29 | a = { bg = colors.red, fg = colors.black }, 30 | b = { bg = colors.fg_gutter, fg = colors.red }, 31 | } 32 | 33 | tokyonight.inactive = { 34 | a = { bg = bg_statusline, fg = colors.blue }, 35 | b = { bg = bg_statusline, fg = colors.fg_gutter, gui = "bold" }, 36 | c = { bg = bg_statusline, fg = colors.fg_gutter }, 37 | } 38 | 39 | if config.lualine_bold then 40 | for _, mode in pairs(tokyonight) do 41 | mode.a.gui = "bold" 42 | end 43 | end 44 | 45 | return tokyonight 46 | -------------------------------------------------------------------------------- /lua/telescope/_extensions/luasnip.lua: -------------------------------------------------------------------------------- 1 | -- Taken from https://github.com/benfowler/telescope-luasnip.nvim/blob/master/lua/telescope/_extensions/luasnip.lua 2 | -- MIT License 3 | 4 | -- Copyright (c) 2021 fhill2 5 | 6 | -- Permission is hereby granted, free of charge, to any person obtaining a copy 7 | -- of this software and associated documentation files (the "Software"), to deal 8 | -- in the Software without restriction, including without limitation the rights 9 | -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | -- copies of the Software, and to permit persons to whom the Software is 11 | -- furnished to do so, subject to the following conditions: 12 | 13 | -- The above copyright notice and this permission notice shall be included in all 14 | -- copies or substantial portions of the Software. 15 | 16 | -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | -- SOFTWARE. 23 | 24 | local has_telescope, telescope = pcall(require, "telescope") 25 | if not has_telescope then 26 | error "This plugins requires nvim-telescope/telescope.nvim" 27 | end 28 | 29 | local actions = require "telescope.actions" 30 | local action_state = require "telescope.actions.state" 31 | local finders = require "telescope.finders" 32 | local pickers = require "telescope.pickers" 33 | local previewers = require "telescope.previewers" 34 | local entry_display = require "telescope.pickers.entry_display" 35 | local conf = require("telescope.config").values 36 | 37 | local filter_null = function(str, default) 38 | return str and str or (default and default or "") 39 | end 40 | 41 | local filter_description = function(name, description) 42 | local result = "" 43 | if description and #description > 1 then 44 | for _, line in ipairs(description) do 45 | result = result .. line .. " " 46 | end 47 | elseif name and description and description[1] ~= name then 48 | result = description[1] 49 | end 50 | 51 | return result 52 | end 53 | 54 | local get_docstring = function(luasnip, ft, context) 55 | local docstring = {} 56 | if context then 57 | local snips_for_ft = luasnip.get_snippets(ft) 58 | if snips_for_ft then 59 | for _, snippet in pairs(snips_for_ft) do 60 | if context.name == snippet.name and context.trigger == snippet.trigger then 61 | docstring = snippet:get_docstring() 62 | end 63 | end 64 | end 65 | end 66 | return docstring 67 | end 68 | 69 | local luasnip_fn = function(opts) 70 | opts = opts or {} 71 | local objs = {} 72 | 73 | -- Account for the fact that luasnip may be lazy-loaded 74 | local has_luasnip, luasnip = pcall(require, "luasnip") 75 | if has_luasnip then 76 | local available = luasnip.available() 77 | 78 | for filename, file in pairs(available) do 79 | for _, snippet in ipairs(file) do 80 | table.insert(objs, { 81 | ft = filename ~= "" and filename or "-", 82 | context = snippet, 83 | }) 84 | end 85 | end 86 | else 87 | print "LuaSnips is not available" 88 | end 89 | 90 | table.sort(objs, function(a, b) 91 | if a.ft ~= b.ft then 92 | return a.ft > b.ft 93 | elseif a.context.name ~= b.context.name then 94 | return a.context.name > b.context.name 95 | else 96 | return a.context.trigger > b.context.trigger 97 | end 98 | end) 99 | 100 | local displayer = entry_display.create { 101 | separator = " ", 102 | items = { 103 | { width = 24 }, 104 | { remaining = true }, 105 | }, 106 | } 107 | 108 | local make_display = function(entry) 109 | return displayer { 110 | entry.value.context.name, 111 | filter_description(entry.value.context.name, entry.value.context.description), 112 | } 113 | end 114 | 115 | pickers 116 | .new(opts, { 117 | prompt_title = "LuaSnip", 118 | finder = finders.new_table { 119 | 120 | results = objs, 121 | entry_maker = function(entry) 122 | return { 123 | value = entry, 124 | display = make_display, 125 | 126 | ordinal = entry.ft 127 | .. " " 128 | .. filter_null(entry.context.trigger) 129 | .. " " 130 | .. filter_null(entry.context.name) 131 | .. " " 132 | .. filter_description(entry.context.name, entry.context.description), 133 | 134 | preview_command = function(_, bufnr) 135 | local snippet = get_docstring(luasnip, entry.ft, entry.context) 136 | vim.api.nvim_set_option_value("filetype", entry.ft, { buf = bufnr }) 137 | if type(snippet) ~= "table" then 138 | local lines = {} 139 | for s in snippet:gmatch "[^\r\n]+" do 140 | table.insert(lines, s) 141 | end 142 | snippet = lines 143 | end 144 | vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, snippet) 145 | end, 146 | } 147 | end, 148 | }, 149 | 150 | previewer = previewers.display_content.new(opts), 151 | sorter = conf.generic_sorter(opts), 152 | attach_mappings = function() 153 | actions.select_default:replace(function(prompt_bufnr) 154 | local selection = action_state.get_selected_entry() 155 | actions.close(prompt_bufnr) 156 | vim.api.nvim_put({ selection.value.context.trigger }, "", true, true) 157 | if luasnip.expandable() then 158 | vim.cmd "startinsert" 159 | luasnip.expand() 160 | vim.cmd "stopinsert" 161 | else 162 | print( 163 | "Snippet '" 164 | .. selection.value.context.name 165 | .. "'" 166 | .. "was selected, but LuaSnip.expandable() returned false" 167 | ) 168 | end 169 | end) 170 | return true 171 | end, 172 | }) 173 | :find() 174 | end -- end custom function 175 | 176 | return telescope.register_extension { exports = { luasnip = luasnip_fn } } 177 | -------------------------------------------------------------------------------- /lua/user/bqf.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, bqf = pcall(require, "bqf") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | bqf.setup { 10 | auto_enable = true, 11 | magic_window = true, 12 | auto_resize_height = false, 13 | func_map = { 14 | split = "s", 15 | vsplit = "v", 16 | stoggleup = "M", 17 | stoggledown = "m", 18 | stogglevm = "m", 19 | filterr = "f", 20 | filter = "F", 21 | }, 22 | preview = { 23 | auto_preview = false, 24 | show_title = true, 25 | delay_syntax = 50, 26 | wrap = false, 27 | should_preview_cb = function(bufnr) 28 | local ret = true 29 | local filename = vim.api.nvim_buf_get_name(bufnr) 30 | local fsize = vim.fn.getfsize(filename) 31 | -- file size greater than 100k can't be previewed automatically 32 | if fsize > 100 * 1024 then 33 | ret = false 34 | end 35 | return ret 36 | end, 37 | }, 38 | } 39 | end 40 | 41 | return M 42 | -------------------------------------------------------------------------------- /lua/user/cle.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.cmake_config = function() 4 | local status_ok, cmake_tools = pcall(require, "cmake-tools") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | cmake_tools.setup { 10 | cmake_command = "cmake", 11 | cmake_build_directory = "build", 12 | cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" }, 13 | cmake_build_options = {}, 14 | cmake_console_size = 10, -- cmake output window height 15 | cmake_show_console = "always", -- "always", "only_on_error" 16 | cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional 17 | cmake_dap_open_command = require("dap").repl.open, -- optional 18 | cmake_variants_message = { 19 | short = { show = true }, 20 | long = { show = true, max_length = 40 }, 21 | }, 22 | } 23 | end 24 | 25 | return M 26 | -------------------------------------------------------------------------------- /lua/user/codelens.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local SIGN_GROUP = "nvim-lightbulblens" 4 | local SIGN_NAME = "LightBulbSign" 5 | 6 | -- Set default sign 7 | if vim.tbl_isempty(vim.fn.sign_getdefined(SIGN_NAME)) then 8 | vim.fn.sign_define(SIGN_NAME, { text = require("user.lsp_kind").icons.code_action, texthl = "MoreMsg" }) 9 | end 10 | 11 | M.show_line_sign = function() 12 | -- Check for code action capability 13 | local code_action_cap_found = false 14 | for _, client in pairs(vim.lsp.get_clients()) do 15 | if client then 16 | if client.supports_method "textDocument/codeAction" then 17 | code_action_cap_found = true 18 | end 19 | end 20 | end 21 | if not code_action_cap_found then 22 | return 23 | end 24 | 25 | local params = require("vim.lsp.util").make_range_params() 26 | params.context = { diagnostics = vim.diagnostic.get(0, { lnum = params.range.start.line }) } 27 | local bufnr = vim.api.nvim_get_current_buf() 28 | vim.lsp.buf_request_all(0, "textDocument/codeAction", params, M.handler_factory(params.range.start.line, bufnr)) 29 | end 30 | 31 | --- Check if the current line contains a codelens action 32 | ---@param cursor {number, number} The cursor position 33 | ---@return boolean True if the line contains a codelens action 34 | M.code_lens_available = function(cursor) 35 | local codelens_actions = {} 36 | for _, l in ipairs(vim.lsp.codelens.get(0)) do 37 | table.insert(codelens_actions, { start = l.range.start, finish = l.range["end"] }) 38 | end 39 | for _, action in ipairs(codelens_actions) do 40 | if 41 | action.start.line <= cursor[1] 42 | and cursor[1] <= action.finish.line 43 | and action.start.character <= cursor[2] 44 | and cursor[2] <= action.finish.character 45 | then 46 | return true 47 | end 48 | end 49 | return false 50 | end 51 | 52 | --- Handler factory to keep track of current lightbulb line. 53 | --- 54 | --- @param line number The line when the the code action request is called 55 | --- @param bufnr number|nil Buffer handle 56 | M.handler_factory = function(line, bufnr) 57 | --- Handler for textDocument/codeAction. 58 | --- 59 | --- See lsp-handler for more information. 60 | --- 61 | --- @private 62 | local function code_action_handler(responses) 63 | local ignored_messages = { 64 | "Extract Block", 65 | "Extract Block To File", 66 | "Extract Function", 67 | "Extract Function To File", 68 | "Extract Variable", 69 | "Inline Variable", 70 | } 71 | -- Check for available code actions from all LSP server responses 72 | local has_actions = false 73 | for _, resp in pairs(responses) do 74 | if resp.result and not vim.tbl_isempty(resp.result) then 75 | for _, action in ipairs(resp.result) do 76 | if not vim.tbl_contains(ignored_messages, action.title) then 77 | has_actions = true 78 | goto continue 79 | end 80 | end 81 | ::continue:: 82 | break 83 | end 84 | end 85 | 86 | local cursor = vim.api.nvim_win_get_cursor(0) 87 | cursor[1] = cursor[1] - 1 88 | if M.code_lens_available(cursor) then 89 | M.update_sign(10, vim.b.lightbulb_line, cursor[1] + 1, bufnr, "code_lens_action") 90 | return 91 | end 92 | 93 | -- No available code actions 94 | if not has_actions then 95 | M.update_sign(10, vim.b.lightbulb_line, nil, bufnr, "code_action") 96 | else 97 | M.update_sign(10, vim.b.lightbulb_line, line + 1, bufnr, "code_action") 98 | end 99 | end 100 | 101 | return M.mk_handler(code_action_handler) 102 | end 103 | 104 | --- Patch for breaking neovim master update to LSP handlers 105 | --- See: https://github.com/neovim/neovim/issues/14090#issuecomment-913198455 106 | M.mk_handler = function(fn) 107 | return function(...) 108 | local config_or_client_id = select(4, ...) 109 | local is_new = type(config_or_client_id) ~= "number" 110 | if is_new then 111 | fn(...) 112 | else 113 | local err = select(1, ...) 114 | local method = select(2, ...) 115 | local result = select(3, ...) 116 | local client_id = select(4, ...) 117 | local bufnr = select(5, ...) 118 | local config = select(6, ...) 119 | fn(err, result, { method = method, client_id = client_id, bufnr = bufnr }, config) 120 | end 121 | end 122 | end 123 | 124 | --- Update sign position from `old_line` to `new_line`. 125 | --- 126 | --- Either line can be optional, and will result in just adding/removing 127 | --- the sign on the given line. 128 | --- 129 | --- @param priority number The priority of the sign to add 130 | --- @param old_line number|nil The line to remove the sign on 131 | --- @param new_line number|nil The line to add the sign on 132 | --- @param bufnr number|nil Buffer handle 133 | --- @param text string the sign icon 134 | --- 135 | M.update_sign = function(priority, old_line, new_line, bufnr, text) 136 | bufnr = bufnr or 0 137 | 138 | if old_line then 139 | vim.fn.sign_unplace(SIGN_GROUP, { id = old_line, buffer = bufnr }) 140 | 141 | -- Update current lightbulb line 142 | vim.b.lightbulb_line = nil 143 | end 144 | 145 | -- Avoid redrawing lightbulb if code action line did not change 146 | if new_line and (vim.b.lightbulb_line ~= new_line) then 147 | vim.fn.sign_place(new_line, SIGN_GROUP, SIGN_NAME, bufnr, { lnum = new_line, priority = priority }) 148 | -- Update current lightbulb line 149 | vim.b.lightbulb_line = new_line 150 | end 151 | local icon = require("user.lsp_kind").icons.code_action 152 | if text == "code_lens_action" then 153 | icon = require("user.lsp_kind").icons.code_lens_action 154 | end 155 | vim.fn.sign_define(SIGN_NAME, { text = icon, texthl = "MoreMsg" }) 156 | end 157 | 158 | return M 159 | -------------------------------------------------------------------------------- /lua/user/colorizer.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, colorizer = pcall(require, "colorizer") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | colorizer.setup({ "*" }, { 10 | RGB = true, -- #RGB hex codes 11 | RRGGBB = true, -- #RRGGBB hex codes 12 | RRGGBBAA = true, -- #RRGGBBAA hex codes 13 | rgb_fn = true, -- CSS rgb() and rgba() functions 14 | hsl_fn = true, -- CSS hsl() and hsla() functions 15 | css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB 16 | css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn 17 | }) 18 | end 19 | 20 | return M 21 | -------------------------------------------------------------------------------- /lua/user/copilot.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | vim.g.copilot_no_tab_map = true 5 | vim.g.copilot_assume_mapped = true 6 | vim.g.copilot_tab_fallback = "" 7 | vim.g.copilot_filetypes = { 8 | ["*"] = false, 9 | python = true, 10 | lua = true, 11 | go = true, 12 | rust = true, 13 | html = true, 14 | c = true, 15 | cpp = true, 16 | java = true, 17 | javascript = true, 18 | typescript = true, 19 | javascriptreact = true, 20 | typescriptreact = true, 21 | terraform = true, 22 | } 23 | end 24 | 25 | return M 26 | -------------------------------------------------------------------------------- /lua/user/crates.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, crates = pcall(require, "crates") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | -- NOTE: use the default values 10 | crates.setup {} 11 | end 12 | 13 | return M 14 | -------------------------------------------------------------------------------- /lua/user/custom_user.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | vim.opt.mousescroll = { "ver:1", "hor:6" } 5 | vim.o.mousefocus = true 6 | vim.o.mousemoveevent = true 7 | vim.o.splitkeep = "screen" 8 | 9 | lvim.builtin.lsp_lines = true 10 | vim.diagnostic.config { virtual_lines = false } -- i only want to use it explicitly ( by calling the toggle function) 11 | lvim.builtin.tmux_lualine = true 12 | if lvim.builtin.tmux_lualine then 13 | vim.opt.cmdheight = 0 14 | vim.opt.laststatus = 0 15 | vim.g.tpipeline_cursormoved = 1 16 | -- HACK: lualine hijacks the statusline, so we need to set it back to what we want 17 | if vim.env.TMUX then 18 | vim.cmd [[ autocmd WinEnter,BufEnter,VimResized,Filetype * setlocal laststatus=0 ]] 19 | end 20 | end 21 | -- NOTE: custom icons doesn't work with nerd font v3 yet 22 | lvim.builtin.custom_web_devicons = false 23 | lvim.use_icons = true -- only set to false if you know what are you doing 24 | lvim.builtin.sell_your_soul_to_devil.active = true 25 | lvim.builtin.sell_your_soul_to_devil.prada = false 26 | -- lvim.builtin.sell_your_soul_to_devil.openai = true -- NOTE: requires valid OPENAI_API_KEY environment variable 27 | lvim.lsp.document_highlight = false 28 | lvim.builtin.task_runner = "async_tasks" 29 | lvim.builtin.dap.active = true 30 | vim.g.instant_username = vim.env.USER 31 | lvim.builtin.global_statusline = true 32 | -- lvim.builtin.dressing.active = true -- NOTE: it has been archived 33 | lvim.builtin.fancy_wild_menu.active = true 34 | lvim.builtin.refactoring.active = true 35 | lvim.builtin.test_runner.runner = "neotest" 36 | lvim.format_on_save = { 37 | enabled = true, 38 | pattern = "*.rs", 39 | timeout = 2000, 40 | filter = require("lvim.lsp.utils").format_filter, 41 | } 42 | lvim.builtin.smooth_scroll = "cinnamon" 43 | lvim.builtin.tree_provider = "neo-tree" 44 | lvim.builtin.noice.active = false 45 | lvim.builtin.go_programming.active = true 46 | lvim.builtin.python_programming.active = true 47 | lvim.builtin.web_programming.active = true 48 | lvim.builtin.web_programming.extra = "typescript-tools.nvim" 49 | lvim.builtin.rust_programming.active = true 50 | lvim.builtin.cpp_programming.active = true 51 | lvim.builtin.borderless_cmp = true 52 | lvim.builtin.colored_args = true 53 | lvim.reload_config_on_save = false -- NOTE: i don't like this 54 | lvim.builtin.mind.active = true 55 | lvim.builtin.motion_provider = "flash" 56 | lvim.builtin.harpoon.active = true 57 | lvim.builtin.symbols_usage.active = false 58 | lvim.builtin.tag_provider = "outline" 59 | lvim.builtin.bigfile.active = false 60 | lvim.builtin.trouble.active = true 61 | lvim.builtin.markdown.active = true 62 | lvim.builtin.project.active = false 63 | lvim.builtin.project.mine = true 64 | end 65 | 66 | return M 67 | -------------------------------------------------------------------------------- /lua/user/dashboard.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local kind = require "user.lsp_kind" 5 | 6 | local header = { 7 | type = "text", 8 | val = require("user.banners").dashboard(), 9 | opts = { 10 | position = "center", 11 | hl = "Comment", 12 | }, 13 | } 14 | 15 | local plugins = "" 16 | local date = os.date "%a %d %b" 17 | if vim.fn.has "linux" == 1 or vim.fn.has "mac" == 1 then 18 | local handle = io.popen 'fd -d 2 . $HOME"/.local/share/lunarvim/site/pack/lazy" | grep pack | wc -l | tr -d "\n" ' 19 | plugins = handle:read "*a" 20 | handle:close() 21 | 22 | plugins = plugins:gsub("^%s*(.-)%s*$", "%1") 23 | else 24 | plugins = "N/A" 25 | end 26 | local minor_len = string.len(vim.version().minor) 27 | local empty_space = "" 28 | for i = 1, minor_len do 29 | empty_space = empty_space .. " " 30 | end 31 | 32 | local plugin_count = { 33 | type = "text", 34 | val = "└─ " 35 | .. kind.cmp_kind.Module 36 | .. " " 37 | .. string.format("% 4d", plugins) 38 | .. " plugins 󰚥 " 39 | .. vim.version().major 40 | .. "." 41 | .. vim.version().minor 42 | .. "." 43 | .. vim.version().patch 44 | .. " ─┘", 45 | opts = { 46 | position = "center", 47 | hl = "String", 48 | }, 49 | } 50 | 51 | local heading = { 52 | type = "text", 53 | val = "┌─ " .. kind.icons.calendar .. empty_space .. " Today is " .. date .. " ─┐", 54 | opts = { 55 | position = "center", 56 | hl = "String", 57 | }, 58 | } 59 | 60 | local fortune = require "alpha.fortune"() 61 | -- fortune = fortune:gsub("^%s+", ""):gsub("%s+$", "") 62 | local footer = { 63 | type = "text", 64 | val = fortune, 65 | opts = { 66 | position = "center", 67 | hl = "Comment", 68 | hl_shortcut = "Comment", 69 | }, 70 | } 71 | 72 | local function button(sc, txt, keybind) 73 | local sc_ = sc:gsub("%s", ""):gsub("SPC", "") 74 | 75 | local opts = { 76 | position = "center", 77 | text = txt, 78 | shortcut = sc, 79 | cursor = 5, 80 | width = 24, 81 | align_shortcut = "right", 82 | hl_shortcut = "Number", 83 | hl = "Function", 84 | } 85 | if keybind then 86 | opts.keymap = { "n", sc_, keybind, { noremap = true, silent = true } } 87 | end 88 | 89 | return { 90 | type = "button", 91 | val = txt, 92 | on_press = function() 93 | local key = vim.api.nvim_replace_termcodes(sc_, true, false, true) 94 | vim.api.nvim_feedkeys(key, "normal", false) 95 | end, 96 | opts = opts, 97 | } 98 | end 99 | 100 | local buttons = { 101 | type = "group", 102 | val = { 103 | button( 104 | "f", 105 | " " .. kind.cmp_kind.Folder .. " Explore", 106 | "lua require('user.telescope').find_project_files()" 107 | ), 108 | button("e", " " .. kind.cmp_kind.File .. " New file", ":ene startinsert "), 109 | button("s", " " .. kind.icons.magic .. " Restore", ":lua require('persisted').load()"), 110 | button("g", " " .. kind.icons.git .. " Git Status", ":lua require 'lvim.core.terminal'.lazygit_toggle()"), 111 | button("r", " " .. kind.icons.clock .. " Recents", ":Telescope oldfiles only_cwd=true"), 112 | button("c", " " .. kind.icons.settings .. " Config", ":e ~/.config/lvim/config.lua"), 113 | button("q", " " .. kind.icons.exit .. " Quit", ":q"), 114 | }, 115 | opts = { 116 | spacing = 1, 117 | }, 118 | } 119 | 120 | local section = { 121 | header = header, 122 | buttons = buttons, 123 | plugin_count = plugin_count, 124 | heading = heading, 125 | footer = footer, 126 | } 127 | 128 | local opts = { 129 | layout = { 130 | { type = "padding", val = 1 }, 131 | section.header, 132 | { type = "padding", val = 2 }, 133 | section.heading, 134 | section.plugin_count, 135 | { type = "padding", val = 1 }, 136 | -- section.top_bar, 137 | section.buttons, 138 | -- section.bot_bar, 139 | -- { type = "padding", val = 1 }, 140 | section.footer, 141 | }, 142 | opts = { 143 | margin = 5, 144 | }, 145 | } 146 | return opts 147 | end 148 | 149 | return M 150 | -------------------------------------------------------------------------------- /lua/user/dev_icons.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.set_icon = function() 4 | require("nvim-web-devicons").set_icon { 5 | toml = { 6 | icon = "📦", 7 | color = "#8FAA54", 8 | name = "Toml", 9 | }, 10 | rs = { 11 | icon = "🦀", 12 | color = "#d28445", 13 | name = "Rust", 14 | }, 15 | tf = { 16 | icon = "", 17 | color = "#3d59a1", 18 | name = "Terraform", 19 | }, 20 | tfvars = { 21 | icon = "", 22 | color = "#51afef", 23 | name = "Terraform", 24 | }, 25 | mod = { 26 | icon = "", 27 | color = "#6a9fb5", 28 | name = "Mod", 29 | }, 30 | sum = { 31 | icon = "", 32 | color = "#6a9fb5", 33 | name = "Sum", 34 | }, 35 | txt = { 36 | icon = "", 37 | color = "#bbc2cf", 38 | name = "Text", 39 | }, 40 | csv = { 41 | icon = " ", 42 | color = "#31B53E", 43 | name = "CSV", 44 | }, 45 | plist = { 46 | icon = "", 47 | color = "#8FAA54", 48 | name = "Plist", 49 | }, 50 | burp = { 51 | icon = "", 52 | color = "#F16529", 53 | name = "Burp", 54 | }, 55 | mp4 = { 56 | icon = "", 57 | color = "#5fd7ff", 58 | name = "MP4", 59 | }, 60 | mkv = { 61 | icon = "", 62 | color = "#5fd7ff", 63 | name = "MKV", 64 | }, 65 | hcl = { 66 | icon = "", 67 | color = "#689FB6", 68 | name = "HCL", 69 | }, 70 | sol = { 71 | icon = "", 72 | color = "#555555", 73 | name = "Sol", 74 | }, 75 | } 76 | end 77 | 78 | M.use_my_icons = function() 79 | for _, sign in ipairs(require('user.builtin').default_diagnostic_config.signs.values) do 80 | vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name }) 81 | end 82 | if lvim.builtin.tree_provider == "nvimtree" then 83 | lvim.builtin.nvimtree.setup.diagnostics.enable = true 84 | lvim.builtin.nvimtree.setup.renderer.icons.webdev_colors = true 85 | lvim.builtin.nvimtree.setup.renderer.icons.show = { 86 | git = true, 87 | folder = true, 88 | file = true, 89 | folder_arrow = true, 90 | } 91 | end 92 | if lvim.builtin.bufferline.active then 93 | lvim.builtin.bufferline.options.show_buffer_icons = true 94 | lvim.builtin.bufferline.options.show_buffer_close_icons = true 95 | end 96 | end 97 | 98 | M.define_dap_signs = function() 99 | vim.fn.sign_define("DapBreakpoint", lvim.builtin.dap.breakpoint) 100 | vim.fn.sign_define("DapStopped", lvim.builtin.dap.stopped) 101 | vim.fn.sign_define( 102 | "DapBreakpointRejected", 103 | { text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } 104 | ) 105 | vim.fn.sign_define( 106 | "DapBreakpointCondition", 107 | { text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } 108 | ) 109 | vim.fn.sign_define( 110 | "DapLogPoint", 111 | { text = "", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" } 112 | ) 113 | end 114 | 115 | return M 116 | -------------------------------------------------------------------------------- /lua/user/diffview.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, diff = pcall(require, "diffview") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | diff.setup { 10 | default_args = { 11 | DiffviewFileHistory = { "%" }, 12 | }, 13 | hooks = { 14 | diff_buf_read = function() 15 | vim.wo.wrap = false 16 | vim.wo.list = false 17 | vim.wo.colorcolumn = "" 18 | end, 19 | }, 20 | enhanced_diff_hl = true, 21 | keymaps = { 22 | view = { q = "DiffviewClose" }, 23 | file_panel = { q = "DiffviewClose" }, 24 | file_history_panel = { q = "DiffviewClose" }, 25 | }, 26 | } 27 | end 28 | 29 | return M 30 | -------------------------------------------------------------------------------- /lua/user/dress.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, dressing = pcall(require, "dressing") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | dressing.setup { 10 | input = { 11 | get_config = function() 12 | if lvim.builtin.noice.active then 13 | return { enabled = false } 14 | end 15 | if vim.api.nvim_get_option_value("filetype", { buf = 0 }) == "neo-tree" then 16 | return { enabled = false } 17 | end 18 | end, 19 | }, 20 | select = { 21 | format_item_override = { 22 | codeaction = function(action_tuple) 23 | local title = action_tuple.action.title:gsub("\r\n", "\\r\\n") 24 | local client = vim.lsp.get_client_by_id(action_tuple.ctx.client_id) 25 | return string.format("%s\t[%s]", title:gsub("\n", "\\n"), client.name) 26 | end, 27 | }, 28 | }, 29 | } 30 | end 31 | 32 | return M 33 | -------------------------------------------------------------------------------- /lua/user/fidget_spinner.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, fidget = pcall(require, "fidget") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | fidget.setup { 10 | progress = { 11 | poll_rate = 0, 12 | suppress_on_insert = false, 13 | ignore_done_already = true, 14 | ignore_empty_message = true, 15 | ignore = { "null-ls", "none-ls" }, 16 | 17 | display = { 18 | done_icon = "", 19 | done_style = "Constant", 20 | progress_icon = { 21 | pattern = { 22 | " ", 23 | " ", 24 | " ", 25 | " ", 26 | " ", 27 | " ", 28 | " ", 29 | " ", 30 | " ", 31 | " ", 32 | " ", 33 | " ", 34 | " ", 35 | " ", 36 | " ", 37 | " ", 38 | " ", 39 | " ", 40 | " ", 41 | " ", 42 | " ", 43 | " ", 44 | " ", 45 | " ", 46 | " ", 47 | " ", 48 | " ", 49 | " ", 50 | }, 51 | period = 1, 52 | }, 53 | format_message = function(msg) 54 | local message = msg.message 55 | if not message then 56 | message = msg.done and " " or " " 57 | end 58 | if msg.percentage ~= nil then 59 | message = string.format("%s (%.0f%%)", message, msg.percentage) 60 | end 61 | return message 62 | end, 63 | }, 64 | }, 65 | notification = { 66 | window = { 67 | winblend = 0, 68 | }, 69 | }, 70 | integration = { 71 | ["nvim-tree"] = { 72 | enable = lvim.builtin.tree_provider == "nvimtree", 73 | }, 74 | }, 75 | } 76 | end 77 | 78 | return M 79 | -------------------------------------------------------------------------------- /lua/user/flash.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.hop = function() 4 | local Flash = require "flash" 5 | 6 | local function format(opts) 7 | return { 8 | { opts.match.label1, "FlashMatch" }, 9 | { opts.match.label2, "FlashLabel" }, 10 | } 11 | end 12 | 13 | Flash.jump { 14 | search = { mode = "search" }, 15 | label = { after = false, before = { 0, 0 }, uppercase = false, format = format }, 16 | pattern = [[\<]], 17 | action = function(match, state) 18 | state:hide() 19 | Flash.jump { 20 | search = { max_length = 0 }, 21 | highlight = { matches = false }, 22 | label = { format = format }, 23 | matcher = function(win) 24 | -- limit matches to the current label 25 | return vim.tbl_filter(function(m) 26 | return m.label == match.label and m.win == win 27 | end, state.results) 28 | end, 29 | labeler = function(matches) 30 | for _, m in ipairs(matches) do 31 | m.label = m.label2 -- use the second label 32 | end 33 | end, 34 | } 35 | end, 36 | labeler = function(matches, state) 37 | local labels = state:labels() 38 | for m, match in ipairs(matches) do 39 | match.label1 = labels[math.floor((m - 1) / #labels) + 1] 40 | match.label2 = labels[(m - 1) % #labels + 1] 41 | match.label = match.label1 42 | end 43 | end, 44 | } 45 | end 46 | 47 | M.keys = { 48 | { 49 | "s", 50 | mode = { "n", "x", "o" }, 51 | function() 52 | require("flash").jump() 53 | end, 54 | desc = "Flash", 55 | }, 56 | { 57 | "S", 58 | mode = { "n", "o", "x" }, 59 | function() 60 | M.hop() 61 | end, 62 | desc = "Flash 2Char", 63 | }, 64 | { 65 | "r", 66 | mode = "o", 67 | function() 68 | require("flash").remote() 69 | end, 70 | desc = "Remote Flash", 71 | }, 72 | { 73 | "R", 74 | mode = { "o", "x" }, 75 | function() 76 | require("flash").treesitter_search() 77 | end, 78 | desc = "Flash Treesitter Search", 79 | }, 80 | { 81 | "", 82 | mode = { "c" }, 83 | function() 84 | require("flash").toggle() 85 | end, 86 | desc = "Toggle Flash Search", 87 | }, 88 | } 89 | 90 | 91 | return M 92 | -------------------------------------------------------------------------------- /lua/user/flutter_tools.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, flt = pcall(require, "flutter-tools") 5 | if not status_ok then 6 | return 7 | end 8 | flt.setup { 9 | ui = { border = "rounded" }, 10 | debugger = { enabled = true, run_via_dap = true, exception_breakpoints = {} }, 11 | outline = { auto_open = false }, 12 | decorations = { 13 | statusline = { device = true, app_version = true }, 14 | }, 15 | widget_guides = { enabled = true, debug = true }, 16 | dev_log = { enabled = false, open_cmd = "tabedit" }, 17 | lsp = { 18 | color = { 19 | enabled = true, 20 | background = true, 21 | virtual_text = false, 22 | }, 23 | settings = { 24 | showTodos = false, 25 | renameFilesWithClasses = "prompt", 26 | updateImportsOnRename = true, 27 | completeFunctionCalls = true, 28 | lineLength = 100, 29 | }, 30 | on_attach = require("lvim.lsp").common_on_attach, 31 | }, 32 | } 33 | end 34 | 35 | return M 36 | -------------------------------------------------------------------------------- /lua/user/gps.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, gp = pcall(require, "nvim-gps") 5 | if not status_ok then 6 | vim.notify "nvim-gps not found" 7 | return 8 | end 9 | 10 | gp.setup { 11 | disable_icons = false, -- Setting it to true will disable all icons 12 | 13 | icons = { 14 | ["class-name"] = " ", -- Classes and class-like objects 15 | ["function-name"] = "󰊕 ", -- Functions 16 | ["method-name"] = " ", -- Methods (functions inside class-like objects) 17 | -- ["container-name"] = "⛶ ", -- Containers (example: lua tables) 18 | ["tag-name"] = "󰓹", -- Tags (example: html tags) 19 | }, 20 | 21 | -- Add custom configuration per language or 22 | -- Disable the plugin for a language 23 | -- Any language not disabled here is enabled by default 24 | languages = { 25 | -- Some languages have custom icons 26 | ["json"] = { 27 | icons = { 28 | ["array-name"] = " ", 29 | ["object-name"] = " ", 30 | ["null-name"] = "[] ", 31 | ["boolean-name"] = "󰦏 ", 32 | ["number-name"] = "# ", 33 | ["string-name"] = " ", 34 | }, 35 | }, 36 | ["latex"] = { 37 | icons = { 38 | ["title-name"] = "#", 39 | ["label-name"] = "", 40 | }, 41 | }, 42 | ["norg"] = { 43 | icons = { 44 | ["title-name"] = "", 45 | }, 46 | }, 47 | ["toml"] = { 48 | icons = { 49 | ["table-name"] = "󰓫 ", 50 | ["array-name"] = " ", 51 | ["boolean-name"] = "󰦏 ", 52 | ["date-name"] = " ", 53 | ["date-time-name"] = "󰃰 ", 54 | ["float-name"] = "󰉧 ", 55 | ["inline-table-name"] = "󰨘 ", 56 | ["integer-name"] = "# ", 57 | ["string-name"] = " ", 58 | ["time-name"] = " ", 59 | }, 60 | }, 61 | ["verilog"] = { 62 | icons = { 63 | ["module-name"] = " ", 64 | }, 65 | }, 66 | ["yaml"] = { 67 | icons = { 68 | ["mapping-name"] = "󰍍 ", 69 | ["sequence-name"] = "󰜩 ", 70 | ["null-name"] = "[] ", 71 | ["boolean-name"] = "󰦏 ", 72 | ["integer-name"] = "# ", 73 | ["float-name"] = "󰉧 ", 74 | ["string-name"] = " ", 75 | }, 76 | }, 77 | ["yang"] = { 78 | icons = { 79 | ["module-name"] = "󰕳", 80 | ["augment-path"] = "󰴠", 81 | ["container-name"] = "󱣘", 82 | ["grouping-name"] = " ", 83 | ["typedef-name"] = "", 84 | ["identity-name"] = "󰻾", 85 | ["list-name"] = "󱃔", 86 | ["leaf-list-name"] = "󰌪", 87 | ["leaf-name"] = "󰲓", 88 | ["action-name"] = "", 89 | }, 90 | }, 91 | }, 92 | 93 | separator = " > ", 94 | 95 | depth = 0, 96 | 97 | -- indicator used when context hits depth limit 98 | depth_limit_indicator = "..", 99 | } 100 | end 101 | 102 | return M 103 | -------------------------------------------------------------------------------- /lua/user/hlslens.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, hlslens = pcall(require, "hlslens") 5 | if not status_ok then 6 | return 7 | end 8 | local opts = { 9 | auto_enable = true, 10 | calm_down = true, 11 | enable_incsearch = false, 12 | nearest_only = false, 13 | override_lens = function(render, plist, nearest, idx, r_idx) 14 | local sfw = vim.v.searchforward == 1 15 | local indicator, text, chunks 16 | local abs_r_idx = math.abs(r_idx) 17 | if abs_r_idx > 1 then 18 | indicator = string.format("%d%s", abs_r_idx, sfw ~= (r_idx > 1) and "" or "") 19 | elseif abs_r_idx == 1 then 20 | indicator = sfw ~= (r_idx == 1) and "" or "" 21 | else 22 | indicator = "" 23 | end 24 | 25 | local lnum, col = unpack(plist[idx]) 26 | if nearest then 27 | local cnt = #plist 28 | if indicator ~= "" then 29 | text = string.format("[%s %d/%d]", indicator, idx, cnt) 30 | else 31 | text = string.format("[%d/%d]", idx, cnt) 32 | end 33 | chunks = { { " ", "Ignore" }, { text, "HlSearchLensNear" } } 34 | else 35 | text = string.format("[%s %d]", indicator, idx) 36 | chunks = { { " ", "Ignore" }, { text, "HlSearchLens" } } 37 | end 38 | render.set_virt(0, lnum - 1, col - 1, chunks, nearest) 39 | end, 40 | } 41 | 42 | hlslens.setup(opts) 43 | require("user.keybindings").set_hlslens_keymaps() 44 | end 45 | 46 | return M 47 | -------------------------------------------------------------------------------- /lua/user/hop.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, hop = pcall(require, "hop") 5 | if not status_ok then 6 | return 7 | end 8 | hop.setup() 9 | require("user.keybindings").set_hop_keymaps() 10 | end 11 | 12 | return M 13 | -------------------------------------------------------------------------------- /lua/user/incline.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local function truncate(str, max_len) 4 | assert(str and max_len, "string and max_len must be provided") 5 | return vim.api.nvim_strwidth(str) > max_len and str:sub(1, max_len) .. "…" or str 6 | end 7 | 8 | local function render(props) 9 | local fmt = string.format 10 | local devicons = require "nvim-web-devicons" 11 | local bufname = vim.api.nvim_buf_get_name(props.buf) 12 | if bufname == "" then 13 | return "[No name]" 14 | end 15 | local ret = vim.api.nvim_get_hl(0, { name = "Directory" }) 16 | local directory_color = string.format("#%06x", ret["fg"]) 17 | local parts = vim.split(vim.fn.fnamemodify(bufname, ":."), "/") 18 | local result = {} 19 | for idx, part in ipairs(parts) do 20 | if next(parts, idx) then 21 | vim.list_extend(result, { 22 | { truncate(part, 20) }, 23 | { fmt(" %s ", ""), guifg = directory_color }, 24 | }) 25 | else 26 | table.insert(result, { part, gui = "bold", guisp = directory_color }) 27 | end 28 | end 29 | local icon, color = devicons.get_icon_color(bufname, nil, { default = true }) 30 | table.insert(result, #result, { icon .. " ", guifg = color }) 31 | return result 32 | end 33 | 34 | M.config = function() 35 | local status_ok, incl = pcall(require, "incline") 36 | if not status_ok then 37 | return 38 | end 39 | 40 | incl.setup { 41 | window = { 42 | zindex = 49, 43 | winhighlight = { 44 | inactive = { 45 | Normal = "Directory", 46 | }, 47 | }, 48 | width = "fit", 49 | padding = { left = 2, right = 1 }, 50 | placement = { vertical = "top", horizontal = "right" }, 51 | margin = { 52 | horizontal = 0, 53 | }, 54 | }, 55 | hide = { 56 | cursorline = false, 57 | focused_win = true, 58 | only_win = false, 59 | }, 60 | render = render, 61 | } 62 | end 63 | 64 | return M 65 | -------------------------------------------------------------------------------- /lua/user/indent_blankline.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.setup = function() 4 | local status_ok, ibl = pcall(require, "ibl") 5 | if not status_ok then 6 | return 7 | end 8 | ibl.setup { 9 | indent = { 10 | char = { "", "┊", "┆", "¦", "|", "¦", "┆", "┊", "" }, 11 | }, 12 | exclude = { 13 | buftypes = { "terminal", "nofile" }, 14 | filetypes = { 15 | "alpha", 16 | "log", 17 | "gitcommit", 18 | "dapui_scopes", 19 | "dapui_stacks", 20 | "dapui_watches", 21 | "dapui_breakpoints", 22 | "dapui_hover", 23 | "LuaTree", 24 | "dbui", 25 | "UltestSummary", 26 | "UltestOutput", 27 | "vimwiki", 28 | "markdown", 29 | "json", 30 | "txt", 31 | "vista", 32 | "NvimTree", 33 | "git", 34 | "TelescopePrompt", 35 | "undotree", 36 | "flutterToolsOutline", 37 | "org", 38 | "orgagenda", 39 | "help", 40 | "startify", 41 | "dashboard", 42 | "lazy", 43 | "neogitstatus", 44 | "Outline", 45 | "Trouble", 46 | "lspinfo", 47 | "", -- for all buffers without a file type 48 | }, 49 | }, 50 | scope = { 51 | enabled = false, 52 | show_start = true, 53 | }, 54 | } 55 | local hooks = require "ibl.hooks" 56 | hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_tab_indent_level) 57 | end 58 | 59 | M.config = function() 60 | lvim.builtin.indentlines.options = { 61 | enabled = true, 62 | bufname_exclude = { "README.md" }, 63 | buftype_exclude = { "terminal", "nofile" }, 64 | filetype_exclude = { 65 | "alpha", 66 | "log", 67 | "gitcommit", 68 | "dapui_scopes", 69 | "dapui_stacks", 70 | "dapui_watches", 71 | "dapui_breakpoints", 72 | "dapui_hover", 73 | "LuaTree", 74 | "dbui", 75 | "UltestSummary", 76 | "UltestOutput", 77 | "vimwiki", 78 | "markdown", 79 | "json", 80 | "txt", 81 | "vista", 82 | "NvimTree", 83 | "git", 84 | "TelescopePrompt", 85 | "undotree", 86 | "flutterToolsOutline", 87 | "org", 88 | "orgagenda", 89 | "help", 90 | "startify", 91 | "dashboard", 92 | "lazy", 93 | "neogitstatus", 94 | "Outline", 95 | "Trouble", 96 | "lspinfo", 97 | "", -- for all buffers without a file type 98 | }, 99 | -- char = "▏", 100 | char_list = { "", "┊", "┆", "¦", "|", "¦", "┆", "┊", "" }, 101 | char_highlight_list = { 102 | "IndentBlanklineIndent1", 103 | "IndentBlanklineIndent1", 104 | "IndentBlanklineIndent1", 105 | "IndentBlanklineIndent1", 106 | "IndentBlanklineIndent1", 107 | "IndentBlanklineIndent1", 108 | }, 109 | show_trailing_blankline_indent = false, 110 | show_first_indent_level = false, 111 | space_char_blankline = " ", 112 | use_treesitter = true, 113 | show_foldtext = false, 114 | show_current_context = true, 115 | show_current_context_start = false, 116 | context_patterns = { 117 | "class", 118 | "return", 119 | "function", 120 | "method", 121 | "^if", 122 | "^do", 123 | "^switch", 124 | "^while", 125 | "jsx_element", 126 | "^for", 127 | "^object", 128 | "^table", 129 | "block", 130 | "arguments", 131 | "if_statement", 132 | "else_clause", 133 | "jsx_element", 134 | "jsx_self_closing_element", 135 | "try_statement", 136 | "catch_clause", 137 | "import_statement", 138 | "operation_type", 139 | }, 140 | } 141 | end 142 | 143 | M.enable = function() 144 | if lvim.builtin.indentlines.mine then 145 | require("ibl").setup_buffer(0, { enabled = true }) 146 | elseif lvim.builtin.indentlines.active then 147 | vim.cmd [[IndentBlanklineEnable!]] 148 | end 149 | end 150 | 151 | M.disable = function() 152 | if lvim.builtin.indentlines.mine then 153 | require("ibl").setup_buffer(0, { enabled = false }) 154 | elseif lvim.builtin.indentlines.active then 155 | vim.cmd [[IndentBlanklineDisable!]] 156 | end 157 | end 158 | 159 | return M 160 | -------------------------------------------------------------------------------- /lua/user/leap.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, leap = pcall(require, "leap") 5 | if not status_ok then 6 | return 7 | end 8 | leap.add_default_mappings() 9 | end 10 | 11 | return M 12 | -------------------------------------------------------------------------------- /lua/user/legendary.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, legend = pcall(require, "legendary") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | legend.setup { 10 | select_prompt = " Legendary ", 11 | commands = { 12 | { ":Telescope live_grep", description = "Find Text ( live grep )" }, 13 | }, 14 | } 15 | end 16 | 17 | return M 18 | -------------------------------------------------------------------------------- /lua/user/lsp_kind.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.mason = { 4 | package_pending = " ", 5 | package_installed = "󰄳 ", 6 | package_uninstalled = " 󰚌", 7 | } 8 | 9 | M.cmp_kind = { 10 | Array = " ", 11 | Boolean = "󰨙 ", 12 | Class = " ", 13 | Codeium = "󰘦 ", 14 | Collapsed = " ", 15 | Color = " ", 16 | Constant = "", 17 | Constructor = " ", 18 | Control = " ", 19 | Copilot = " ", 20 | Default = " ", 21 | Enum = "ℰ", 22 | EnumMember = " ", 23 | Event = " ", 24 | Field = "󰜢", 25 | File = "󰈚 ", 26 | Folder = " ", 27 | Function = " ", 28 | Implementation = "", 29 | Interface = " ", 30 | Key = " ", 31 | Keyword = " ", 32 | Macro = " ", 33 | Method = "ƒ", 34 | Module = " ", 35 | Namespace = "󰦮 ", 36 | Null = " ", 37 | Number = "󰎠 ", 38 | Object = " ", 39 | Operator = " ", 40 | Package = " ", 41 | Parameter = "", 42 | Property = " ", 43 | Reference = " ", 44 | Snippet = " ", -- ""," "," " 45 | spell = "󰓆", 46 | StaticMethod = "", 47 | String = "󰅳 ", -- " ","𝓐 " ," " ,"󰅳 " 48 | Struct = "󰙅", 49 | TabNine = "󰏚 ", 50 | Text = " ", 51 | TypeAlias = "", 52 | TypeParameter = " ", 53 | Undefined = "", 54 | Unit = "󰑭", 55 | Value = " ", 56 | Variable = "󰀫 ", 57 | } 58 | 59 | M.icons = { 60 | error = " ", 61 | warn = " ", 62 | info = "", 63 | hint = " ", 64 | code_action = "", 65 | code_lens_action = "󰄄", 66 | test = "", 67 | docs = "", 68 | clock = "󰥔 ", 69 | calendar = " ", 70 | buffer = " ", 71 | settings = " ", 72 | ls_inactive = "󰒎 ", 73 | ls_active = "󰒍 ", 74 | question = " ", 75 | screen = "󰐯", 76 | dart = " ", 77 | config = " ", 78 | git = " ", 79 | magic = " ", 80 | exit = " ", 81 | repo = "", 82 | term = " ", 83 | } 84 | 85 | M.nvim_tree_icons = { 86 | default = "", 87 | symlink = "", 88 | git = { 89 | unmerged = "", 90 | added = "", 91 | deleted = "", 92 | modified = "", 93 | renamed = "", 94 | untracked = "", 95 | ignored = "", 96 | unstaged = "󱍯", 97 | staged = "", 98 | conflict = "", 99 | }, 100 | folder = { 101 | arrow_closed = "", 102 | arrow_open = "", 103 | default = "", 104 | open = "", 105 | empty = "", 106 | empty_open = "", 107 | symlink = "", 108 | symlink_open = "", 109 | }, 110 | } 111 | 112 | M.todo_comments = { 113 | FIX = " ", 114 | TODO = " ", 115 | HACK = " ", 116 | WARN = " ", 117 | PERF = " ", 118 | NOTE = " ", 119 | ERROR = " ", 120 | REFS = "", 121 | SHIELD = "", 122 | } 123 | 124 | M.numbers = { 125 | "󰼏 ", 126 | "󰼐 ", 127 | "󰼑 ", 128 | "󰼒 ", 129 | "󰼓 ", 130 | "󰼔 ", 131 | "󰼕 ", 132 | "󰼖 ", 133 | "󰼗 ", 134 | "󰿪 ", 135 | } 136 | 137 | M.file_icons = { 138 | Brown = { "" }, 139 | Aqua = { "" }, 140 | LightBlue = { "", "" }, 141 | Blue = { "", "", "", "", "", "", "", "", "", "", "", "", "" }, 142 | DarkBlue = { "", "" }, 143 | Purple = { "", "", "", "", "" }, 144 | Red = { "", "", "", "", "", "" }, 145 | Beige = { "", "", "" }, 146 | Yellow = { "", "", "λ", "", "" }, 147 | Orange = { "", "" }, 148 | DarkOrange = { "", "", "", "", "" }, 149 | Pink = { "", "" }, 150 | Salmon = { "" }, 151 | Green = { "", "", "", "", "", "" }, 152 | LightGreen = { "", "", "", "﵂" }, 153 | White = { "", "", "", "", "", "" }, 154 | } 155 | 156 | return M 157 | -------------------------------------------------------------------------------- /lua/user/lsp_signature.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, sig = pcall(require, "lsp_signature") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | local cfg = { 10 | bind = true, 11 | doc_lines = 10, 12 | floating_window = false, -- show hint in a floating window, set to false for virtual text only mode 13 | floating_window_above_cur_line = true, 14 | fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters 15 | hint_enable = true, -- virtual hint enable 16 | -- hint_prefix = "🐼 ", -- Panda for parameter 17 | hint_prefix = " ", 18 | hint_scheme = "String", 19 | -- use_lspsaga = false, -- set to true if you want to use lspsaga popup 20 | hi_parameter = "Search", -- how your parameter will be highlight 21 | max_height = 12, -- max height of signature floating_window, if content is more than max_height, you can scroll down 22 | -- to view the hiding contents 23 | max_width = 120, -- max_width of signature floating_window, line will be wrapped if exceed max_width 24 | handler_opts = { 25 | border = "single", -- double, single, shadow, none 26 | }, 27 | -- transpancy = 80, 28 | -- extra_trigger_chars = { "(", "," }, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","} 29 | zindex = 1002, -- by default it will be on top of all floating windows, set to 50 send it to bottom 30 | debug = false, -- set to true to enable debug logging 31 | log_path = "debug_log_file_path", -- debug log path 32 | padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc 33 | shadow_blend = 36, -- if you using shadow as border use this set the opacity 34 | shadow_guibg = "Black", -- if you using shadow as border use this set the color e.g. 'Green' or '#121315' 35 | } 36 | sig.setup(cfg) 37 | end 38 | 39 | return M 40 | -------------------------------------------------------------------------------- /lua/user/markv.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local function generic_hl(group) 4 | return { 5 | ["github%.com/[%a%d%-%_%.]+%/?$"] = { 6 | hl = group, 7 | }, 8 | ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/?$"] = { 9 | hl = group, 10 | }, 11 | ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+/tree/[%a%d%-%_%.]+%/?$"] = { 12 | hl = group, 13 | }, 14 | ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+/commits/[%a%d%-%_%.]+%/?$"] = { 15 | hl = group, 16 | }, 17 | ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/releases$"] = { 18 | hl = group, 19 | }, 20 | ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/tags$"] = { 21 | hl = group, 22 | }, 23 | ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/issues$"] = { 24 | hl = group, 25 | }, 26 | ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/pulls$"] = { 27 | hl = group, 28 | }, 29 | ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/wiki$"] = { 30 | hl = group, 31 | }, 32 | } 33 | end 34 | 35 | M.config = function() 36 | local status_ok, mv = pcall(require, "markview") 37 | if not status_ok then 38 | return 39 | end 40 | local presets = require "markview.presets" 41 | 42 | mv.setup { 43 | markdown_inline = { 44 | heckboxes = presets.checkboxes.nerd, 45 | hyperlinks = generic_hl "MarkviewHyperlink", 46 | uri_autolinks = generic_hl "MarkviewEmail", 47 | }, 48 | markdown = { 49 | headings = presets.headings.glow, 50 | tables = presets.tables.rounded, 51 | code_blocks = { sign = false }, 52 | reference_definitions = generic_hl "MarkviewPalette4Fg", 53 | }, 54 | typst = { 55 | url_links = generic_hl "MarkviewEmail", 56 | }, 57 | } 58 | end 59 | 60 | return M 61 | -------------------------------------------------------------------------------- /lua/user/metals.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.start = function() 4 | local status_ok, metals = pcall(require, "metals") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | local metals_config = metals.bare_config() 10 | 11 | vim.opt.shortmess:remove "F" 12 | require("telescope").load_extension "metals" 13 | 14 | metals_config.settings = { 15 | showImplicitArguments = true, 16 | showInferredType = true, 17 | excludedPackages = { 18 | "akka.actor.typed.javadsl", 19 | "com.github.swagger.akka.javadsl", 20 | "akka.stream.javadsl", 21 | }, 22 | fallbackScalaVersion = lvim.builtin.metals.fallbackScalaVersion, 23 | serverVersion = lvim.builtin.metals.serverVersion, 24 | bloopVersion = lvim.builtin.metals.bloopVersion, 25 | serverProperties = { 26 | "-Xms750m", 27 | "-Xmx5G", 28 | }, 29 | } 30 | 31 | metals_config.init_options.statusBarProvider = "on" 32 | metals_config.capabilities = require("lvim.lsp").common_capabilities() 33 | metals_config.on_attach = function(client, bufnr) 34 | require("lvim.lsp").common_on_attach(client, bufnr) 35 | metals.setup_dap() 36 | end 37 | 38 | metals.initialize_or_attach(metals_config) 39 | end 40 | 41 | return M 42 | -------------------------------------------------------------------------------- /lua/user/mind.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, mnd = pcall(require, "mind") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | local function sep_os_replacer(str) 10 | local result = str 11 | local path_sep = package.config:sub(1, 1) 12 | result = result:gsub("/", path_sep) 13 | return result 14 | end 15 | local join_path = require("lvim.utils").join_paths 16 | 17 | mnd.setup { 18 | persistence = { 19 | state_path = sep_os_replacer(join_path(vim.fn.expand(lvim.builtin.mind.root_path), "/mind.json")), 20 | data_dir = sep_os_replacer(join_path(vim.fn.expand(lvim.builtin.mind.root_path), "/data")), 21 | }, 22 | 23 | ui = { 24 | width = 40, 25 | icon_preset = { 26 | { " ", "Sub-project" }, 27 | { " ", "Journal, newspaper, weekly and daily news" }, 28 | { "󰞏 ", "For when you have an idea" }, 29 | { " ", "Note taking?" }, 30 | { " ", "Task management" }, 31 | { " ", "Uncheck, empty square or backlog" }, 32 | { "󰡖 ", "Full square or on-going" }, 33 | { "󰄵 ", "Check or done" }, 34 | { " ", "Trash bin, deleted, cancelled, etc." }, 35 | { " ", "GitHub" }, 36 | { "󱎴 ", "Monitoring" }, 37 | { " ", "Internet, Earth, everyone!" }, 38 | { " ", "Frozen, on-hold" }, 39 | }, 40 | highlight = { 41 | node_root = "Number", 42 | }, 43 | }, 44 | 45 | keymaps = { 46 | normal = { 47 | T = function(args) 48 | require("mind.ui").with_cursor(function(line) 49 | local tree = args.get_tree() 50 | local node = require("mind.node").get_node_by_line(tree, line) 51 | 52 | if node.icon == nil or node.icon == " " then 53 | node.icon = " " 54 | end 55 | 56 | args.save_tree() 57 | require("mind.ui").rerender(tree, args.opts) 58 | end) 59 | end, 60 | }, 61 | }, 62 | } 63 | end 64 | 65 | return M 66 | -------------------------------------------------------------------------------- /lua/user/neoclip.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, neoclip = pcall(require, "neoclip") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | neoclip.setup { 10 | history = 50, 11 | enable_persistent_history = lvim.builtin.neoclip.enable_persistent_history, 12 | db_path = vim.fn.stdpath "data" .. "/neoclip.sqlite3", 13 | keys = { 14 | telescope = { 15 | i = { select = "", paste = "", paste_behind = "" }, 16 | n = { select = "p", paste = "", paste_behind = "P" }, 17 | }, 18 | }, 19 | } 20 | local function clip() 21 | local opts = { 22 | winblend = 10, 23 | layout_strategy = "flex", 24 | layout_config = { 25 | prompt_position = "top", 26 | width = 0.8, 27 | height = 0.6, 28 | horizontal = { width = { padding = 0.15 } }, 29 | vertical = { preview_height = 0.70 }, 30 | }, 31 | borderchars = { 32 | prompt = { "─", "│", " ", "│", "╭", "╮", "│", "│" }, 33 | results = { "─", "│", "─", "│", "├", "┤", "╯", "╰" }, 34 | preview = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, 35 | }, 36 | border = {}, 37 | shorten_path = false, 38 | } 39 | local dropdown = require("telescope.themes").get_dropdown(opts) 40 | require("telescope").extensions.neoclip.default(dropdown) 41 | end 42 | local whk_status, whk = pcall(require, "which-key") 43 | if not whk_status then 44 | return 45 | end 46 | whk.register { 47 | ["y"] = { clip, " open yank history" }, 48 | } 49 | end 50 | 51 | return M 52 | -------------------------------------------------------------------------------- /lua/user/neotree.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local tree_icons = require("user.lsp_kind").nvim_tree_icons 5 | require("neo-tree").setup { 6 | popup_border_style = "rounded", 7 | enable_diagnostics = false, 8 | source_selector = { 9 | winbar = true, 10 | separator_active = " ", 11 | statusline = false, 12 | sources = { 13 | { 14 | source = "filesystem", 15 | display_name = " 󰉓 Files ", 16 | }, 17 | { 18 | source = "buffers", 19 | display_name = " 󰈙 Buffers ", 20 | }, 21 | { 22 | source = "git_status", 23 | display_name = " 󰊢 Git ", 24 | }, 25 | }, 26 | }, 27 | enable_git_status = true, 28 | git_status_async = true, 29 | nesting_rules = { 30 | ["dart"] = { "freezed.dart", "g.dart" }, 31 | }, 32 | default_component_configs = { 33 | indent = { 34 | padding = 0, 35 | with_expanders = false, 36 | }, 37 | icon = { 38 | folder_closed = tree_icons.folder.default, 39 | folder_open = tree_icons.folder.open, 40 | folder_empty = tree_icons.folder.empty_open, 41 | }, 42 | modified = { 43 | symbol = " ", 44 | }, 45 | git_status = { 46 | symbols = tree_icons.git, 47 | }, 48 | }, 49 | window = { 50 | position = "left", 51 | width = 30, 52 | }, 53 | filesystem = { 54 | group_empty_dirs = true, 55 | filtered_items = { 56 | visible = false, 57 | hide_dotfiles = true, 58 | hide_gitignored = false, 59 | hide_by_name = { 60 | ".DS_Store", 61 | "thumbs.db", 62 | "node_modules", 63 | "__pycache__", 64 | }, 65 | never_show = { 66 | ".DS_Store", 67 | }, 68 | }, 69 | window = { 70 | mappings = { 71 | ["h"] = "navigate_up", 72 | ["l"] = "open", 73 | }, 74 | }, 75 | follow_current_file = true, 76 | hijack_netrw_behavior = "open_current", 77 | use_libuv_file_watcher = true, 78 | }, 79 | git_status = { 80 | window = { 81 | position = "float", 82 | }, 83 | }, 84 | event_handlers = { 85 | { 86 | event = "vim_buffer_enter", 87 | handler = function(_) 88 | if vim.bo.filetype == "neo-tree" then 89 | vim.wo.signcolumn = "auto" 90 | end 91 | end, 92 | }, 93 | }, 94 | } 95 | end 96 | 97 | return M 98 | -------------------------------------------------------------------------------- /lua/user/noice.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, noice = pcall(require, "noice") 5 | if not status_ok then 6 | return 7 | end 8 | local spinners = require "noice.util.spinners" 9 | spinners.spinners["mine"] = { 10 | frames = { 11 | " ", 12 | " ", 13 | " ", 14 | " ", 15 | " ", 16 | " ", 17 | " ", 18 | " ", 19 | " ", 20 | " ", 21 | " ", 22 | " ", 23 | " ", 24 | " ", 25 | " ", 26 | " ", 27 | " ", 28 | " ", 29 | " ", 30 | " ", 31 | " ", 32 | " ", 33 | " ", 34 | " ", 35 | " ", 36 | " ", 37 | " ", 38 | " ", 39 | }, 40 | interval = 80, 41 | } 42 | noice.setup { 43 | format = { 44 | spinner = { 45 | name = "mine", 46 | hl = "Constant", 47 | }, 48 | }, 49 | lsp = { 50 | progress = { 51 | enabled = false, 52 | format = { 53 | { "{data.progress.percentage} ", hl_group = "Comment" }, 54 | { "{spinner} ", hl_group = "NoiceLspProgressSpinner" }, 55 | { "{data.progress.title} ", hl_group = "Comment" }, 56 | }, 57 | format_done = {}, 58 | }, 59 | hover = { enabled = false }, 60 | signature = { enabled = false, auto_open = { enabled = false } }, 61 | override = { 62 | ["vim.lsp.util.convert_input_to_markdown_lines"] = true, 63 | ["vim.lsp.util.stylize_markdown"] = false, 64 | ["cmp.entry.get_documentation"] = true, 65 | }, 66 | }, 67 | cmdline = { 68 | format = { 69 | filter = { pattern = "^:%s*!", icon = " ", ft = "sh" }, 70 | IncRename = { 71 | pattern = "^:%s*IncRename%s+", 72 | icon = " ", 73 | conceal = true, 74 | opts = { 75 | -- relative = "cursor", 76 | -- size = { min_width = 20 }, 77 | -- position = { row = -3, col = 0 }, 78 | buf_options = { filetype = "text" }, 79 | }, 80 | }, 81 | }, 82 | }, 83 | views = { 84 | cmdline_popup = { 85 | border = { 86 | style = "none", 87 | padding = { 1, 2 }, 88 | }, 89 | win_options = { 90 | winblend = 5, 91 | winhighlight = { 92 | Normal = "NormalFloat", 93 | FloatBorder = "NoiceCmdlinePopupBorder", 94 | IncSearch = "", 95 | Search = "", 96 | }, 97 | cursorline = false, 98 | }, 99 | }, 100 | }, 101 | popupmenu = { 102 | enabled = not lvim.builtin.fancy_wild_menu.active, 103 | }, 104 | routes = { 105 | { 106 | view = "notify", 107 | filter = { event = "msg_showmode" }, 108 | }, 109 | { 110 | filter = { 111 | event = "msg_show", 112 | find = "%d+L, %d+B", 113 | }, 114 | view = "mini", 115 | }, 116 | { 117 | view = "cmdline_output", 118 | filter = { cmdline = "^:", min_height = 5 }, 119 | -- BUG: will be fixed after https://github.com/neovim/neovim/issues/21044 gets merged 120 | }, 121 | { 122 | filter = { event = "msg_show", kind = "search_count" }, 123 | opts = { skip = true }, 124 | }, 125 | { 126 | filter = { 127 | event = "msg_show", 128 | find = "; before #", 129 | }, 130 | opts = { skip = true }, 131 | }, 132 | { 133 | filter = { 134 | event = "msg_show", 135 | find = "; after #", 136 | }, 137 | opts = { skip = true }, 138 | }, 139 | { 140 | filter = { 141 | event = "msg_show", 142 | find = " lines, ", 143 | }, 144 | opts = { skip = true }, 145 | }, 146 | { 147 | filter = { 148 | event = "msg_show", 149 | find = "go up one level", 150 | }, 151 | opts = { skip = true }, 152 | }, 153 | { 154 | filter = { 155 | event = "msg_show", 156 | find = "yanked", 157 | }, 158 | opts = { skip = true }, 159 | }, 160 | { 161 | filter = { find = "No active Snippet" }, 162 | opts = { skip = true }, 163 | }, 164 | { 165 | filter = { find = "waiting for cargo metadata" }, 166 | opts = { skip = true }, 167 | }, 168 | }, 169 | } 170 | end 171 | 172 | return M 173 | -------------------------------------------------------------------------------- /lua/user/ntest.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, nt = pcall(require, "neotest") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | local namespace = vim.api.nvim_create_namespace "neotest" 10 | vim.diagnostic.config({ 11 | virtual_text = { 12 | format = function(diagnostic) 13 | return diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "") 14 | end, 15 | }, 16 | }, namespace) 17 | 18 | local opts = { 19 | running = { 20 | concurrent = false, 21 | }, 22 | status = { 23 | virtual_text = true, 24 | signs = false, 25 | }, 26 | strategies = { 27 | integrated = { 28 | width = 180, 29 | }, 30 | }, 31 | discovery = { 32 | enabled = true, 33 | }, 34 | diagnostic = { 35 | enabled = true, 36 | }, 37 | icons = { 38 | running = require("user.lsp_kind").icons.clock, 39 | }, 40 | floating = { 41 | border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" }, 42 | }, 43 | adapters = { 44 | require "neotest-rust", 45 | require "neotest-go" { 46 | experimental = { 47 | test_table = true, 48 | }, 49 | }, 50 | require "neotest-python" { 51 | dap = { justMyCode = false, console = "integratedTerminal" }, 52 | }, 53 | require "neotest-plenary", 54 | require "neotest-zig" { 55 | dap = { 56 | adapter = "lldb", 57 | }, 58 | }, 59 | }, 60 | } 61 | 62 | if lvim.builtin.task_runner == "overseer" then 63 | opts.consumers = { 64 | overseer = require "neotest.consumers.overseer", 65 | } 66 | opts.overseer = { 67 | enabled = true, 68 | force_default = true, 69 | } 70 | end 71 | 72 | nt.setup(opts) 73 | end 74 | 75 | M.get_env = function() 76 | local env = {} 77 | for _, file in ipairs { ".env" } do 78 | if vim.fn.empty(vim.fn.glob(file)) ~= 0 then 79 | break 80 | end 81 | 82 | for _, line in ipairs(vim.fn.readfile(file)) do 83 | for name, value in string.gmatch(line, "(.+)=['\"]?(.*)['\"]?") do 84 | local str_end = string.sub(value, -1, -1) 85 | if str_end == "'" or str_end == '"' then 86 | value = string.sub(value, 1, -2) 87 | end 88 | 89 | env[name] = value 90 | end 91 | end 92 | end 93 | return env 94 | end 95 | 96 | M.run_all = function() 97 | local neotest = require "neotest" 98 | if lvim.builtin.task_runner == "overseer" then 99 | neotest.run.run(vim.fn.expand "%") 100 | else 101 | for _, adapter_id in ipairs(neotest.run.adapters()) do 102 | neotest.run.run { suite = true, adapter = adapter_id } 103 | end 104 | end 105 | end 106 | 107 | M.cancel = function() 108 | require("neotest").run.stop { interactive = true } 109 | end 110 | 111 | M.run_file_sync = function() 112 | require("neotest").run.run { vim.fn.expand "%", concurrent = false } 113 | end 114 | 115 | return M 116 | -------------------------------------------------------------------------------- /lua/user/null_ls/go.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | local methods = require "null-ls.methods" 3 | local code_action = methods.internal.CODE_ACTION 4 | local helpers = require "user.null_ls.helpers" 5 | 6 | M.gostructhelper = helpers.make_code_action { 7 | name = "gostructhelper", 8 | method = code_action, 9 | filetypes = { "go" }, 10 | action_fn = function(params) 11 | local typ = helpers.extract_struct_name(params) 12 | if not typ then 13 | return 14 | end 15 | 16 | local command = "gostructhelper" 17 | local actions = { 18 | { 19 | title = "[gostructhelper] Generate constructor", 20 | command = command, 21 | stdin = true, 22 | args = { "-stdin", "-file", params.bufname, "-type", typ, "-constructor" }, 23 | }, 24 | { 25 | title = "[gostructhelper] Generate getter", 26 | command = command, 27 | stdin = true, 28 | args = { "-stdin", "-file", params.bufname, "-type", typ, "-getter" }, 29 | }, 30 | } 31 | return actions 32 | end, 33 | } 34 | 35 | M.gomodifytags = helpers.make_code_action { 36 | name = "gomodifytags", 37 | filetypes = { "go" }, 38 | method = code_action, 39 | action_fn = function(params) 40 | local typ = helpers.extract_struct_name(params) 41 | if not typ then 42 | return 43 | end 44 | -- local tool = "gomodifytags" 45 | -- local config = { 46 | -- cmd = "./" .. tool, 47 | 48 | -- install_script = [[ 49 | -- GOPATH=$(pwd) GOBIN=$(pwd) GO111MODULE=on go get -v github.com/fatih/gomodifytags 50 | -- GOPATH=$(pwd) GO111MODULE=on go clean -modcache 51 | -- ]], 52 | -- } 53 | local command = "gomodifytags" 54 | local actions = { 55 | { 56 | title = "[gomodifytags] Add struct tags", 57 | callback = function(invoke_cli) 58 | local tag = helpers.prompt_tag_name() 59 | if not tag then 60 | return 61 | end 62 | invoke_cli { 63 | command = command, 64 | args = { "-file", params.bufname, "-struct", typ, "-skip-unexported", "-add-tags", tag }, 65 | } 66 | end, 67 | }, 68 | { 69 | title = "[gomodifytags] Remove struct tags", 70 | callback = function(invoke_cli) 71 | local tag = helpers.prompt_tag_name() 72 | if not tag then 73 | return 74 | end 75 | invoke_cli { 76 | command = command, 77 | args = { "-file", params.bufname, "-struct", typ, "-skip-unexported", "-remove-tags", tag }, 78 | } 79 | end, 80 | }, 81 | { 82 | title = "[gomodifytags] Clear struct tags", 83 | command = command, 84 | args = { "-file", params.bufname, "-struct", typ, "-skip-unexported", "-clear-tags" }, 85 | }, 86 | } 87 | return actions 88 | end, 89 | } 90 | 91 | return M 92 | -------------------------------------------------------------------------------- /lua/user/null_ls/helpers.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | local methods = require "null-ls.methods" 3 | local c = require "null-ls.config" 4 | local loop = require "null-ls.loop" 5 | local code_action = methods.internal.CODE_ACTION 6 | 7 | M.extract_struct_name = function(params) 8 | local linenr = params.row 9 | local line = params.content[linenr] 10 | return line:match "^type (.*) struct" 11 | end 12 | 13 | M.prompt_tag_name = function() 14 | return vim.fn.input "Enter struct tag: " 15 | end 16 | 17 | M.make_code_action = function(opts) 18 | local name = opts.name 19 | local filetypes = opts.filetypes or {} 20 | local action_fn = opts.action_fn 21 | local save_on_return = opts.save_on_return or true 22 | 23 | return { 24 | name = name, 25 | method = code_action, 26 | filetypes = filetypes, 27 | generator = { 28 | fn = function(params) 29 | -- cli callback handler 30 | local handler = function(_, output) 31 | if not output then 32 | return 33 | end 34 | 35 | -- patch params method 36 | params.lsp_method = methods.lsp.FORMATTING 37 | M.apply_edits({ 38 | { 39 | row = 1, 40 | col = 1, 41 | end_row = vim.tbl_count(params.content) + 1, 42 | end_col = 1, 43 | text = output, 44 | }, 45 | }, params) 46 | 47 | if save_on_return then 48 | vim.schedule(function() 49 | vim.cmd(params.bufnr .. "bufdo! silent keepjumps noautocmd update") 50 | end) 51 | end 52 | end 53 | 54 | -- function to invoke cli 55 | local invoke_cli = function(action) 56 | local command = action.command 57 | local args = action.args 58 | local timeout = action.timeout or c.get().default_timeout 59 | local stdin = action.stdin or false 60 | assert( 61 | vim.fn.executable(command) > 0, 62 | string.format("command %s is not executable (make sure it's installed and on your $PATH)", command) 63 | ) 64 | 65 | local client = vim.lsp.get_client_by_id(params.client_id) 66 | local spawn_opts = { 67 | cwd = client and client.config.root_dir or vim.fn.getcwd(), 68 | input = command, 69 | handler = handler, 70 | timeout = timeout, 71 | } 72 | if stdin then 73 | local content = table.concat(params.content, "\n") 74 | spawn_opts["input"] = content 75 | end 76 | 77 | loop.spawn(command, args, spawn_opts) 78 | end 79 | 80 | local action_list = action_fn(params) 81 | if not action_list then 82 | return 83 | end 84 | 85 | local actions = {} 86 | for _, action in pairs(action_list) do 87 | table.insert(actions, { 88 | title = action.title, 89 | action = function() 90 | if action.callback then 91 | action.callback(invoke_cli) 92 | else 93 | invoke_cli(action) 94 | end 95 | end, 96 | }) 97 | end 98 | 99 | return actions 100 | end, 101 | }, 102 | } 103 | end 104 | 105 | M.apply_edits = function(edits, params) 106 | local bufnr = params.bufnr 107 | -- directly use handler, since formatting_sync uses a custom handler that won't work if called twice 108 | -- formatting and rangeFormatting handlers should be identical 109 | local handler = require("null-ls.client").resolve_handler(params.lsp_method) 110 | 111 | local diffed_edits = {} 112 | for _, edit in ipairs(edits) do 113 | local split_text, line_ending = require("null-ls.utils").split_at_newline(bufnr, edit.text) 114 | local diffed = require("null-ls.diff").compute_diff(params.content, split_text, line_ending) 115 | -- check if the computed diff is an actual edit 116 | if not (diffed.newText == "" and diffed.rangeLength == 0) then 117 | table.insert(diffed_edits, diffed) 118 | end 119 | end 120 | 121 | handler(nil, diffed_edits, { 122 | method = params.lsp_method, 123 | client_id = params.client_id, 124 | bufnr = bufnr, 125 | }) 126 | end 127 | 128 | return M 129 | -------------------------------------------------------------------------------- /lua/user/null_ls/init.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | -- NOTE: By default, all null-ls providers are checked on startup. 5 | -- If you want to avoid that or want to only set up the provider 6 | -- when you opening the associated file-type, 7 | -- then you can use filetype plugins for this purpose. 8 | -- https://www.lunarvim.org/languages/#lazy-loading-the-formatter-setup 9 | local status_ok, nls = pcall(require, "null-ls") 10 | if not status_ok then 11 | return 12 | end 13 | local vale_config = vim.env.HOME .. "/.vale.ini" 14 | local semgrep_rule_folder = vim.env.HOME .. "/.config/semgrep/semgrep-rules/" 15 | local use_semgrep = false 16 | if vim.fn.filereadable(semgrep_rule_folder .. "template.yaml") then 17 | use_semgrep = true 18 | end 19 | -- NOTE: disabling revive due to performance issues on Sonoma 20 | -- local revive_conf = vim.fn.findfile(os.getenv "HOME" .. "/.config/revive.toml") 21 | -- local revive_args = { "-formatter", "json", "./..." } 22 | -- if revive_conf then 23 | -- revive_args = { "-formatter", "json", "-config", revive_conf, "./..." } 24 | -- end 25 | 26 | local custom_go_actions = require "user.null_ls.go" 27 | local custom_md_hover = require "user.null_ls.markdown" 28 | local sources = { 29 | -- NOTE: npm install -g prettier prettier-plugin-solidity 30 | nls.builtins.formatting.prettier.with { 31 | filetypes = { "solidity" }, 32 | timeout = 10000, 33 | }, 34 | nls.builtins.formatting.prettierd.with { 35 | condition = function(utils) 36 | return not utils.root_has_file { ".eslintrc", ".eslintrc.js" } 37 | end, 38 | prefer_local = "node_modules/.bin", 39 | }, 40 | nls.builtins.formatting.stylua, 41 | nls.builtins.formatting.goimports, 42 | nls.builtins.formatting.gofumpt, 43 | nls.builtins.formatting.cmake_format, 44 | nls.builtins.formatting.scalafmt, 45 | nls.builtins.formatting.sqlformat, 46 | nls.builtins.formatting.terraform_fmt.with { 47 | filetypes = { "terraform", "tf", "terraform-vars", "hcl" }, 48 | }, 49 | -- Support for nix files 50 | nls.builtins.formatting.alejandra, 51 | nls.builtins.formatting.shfmt.with { extra_args = { "-i", "2", "-ci" } }, 52 | nls.builtins.formatting.black.with { extra_args = { "--fast" }, filetypes = { "python" } }, 53 | nls.builtins.formatting.isort.with { extra_args = { "--profile", "black" }, filetypes = { "python" } }, 54 | nls.builtins.diagnostics.ansiblelint.with { 55 | condition = function(utils) 56 | return utils.root_has_file "roles" and utils.root_has_file "inventories" 57 | end, 58 | }, 59 | nls.builtins.diagnostics.solhint.with { 60 | condition = function(utils) 61 | return utils.root_has_file ".solhint.json" 62 | end, 63 | }, 64 | nls.builtins.diagnostics.hadolint, 65 | nls.builtins.diagnostics.selene, 66 | nls.builtins.diagnostics.semgrep.with { 67 | condition = function(utils) 68 | return utils.root_has_file ".semgrepignore" and use_semgrep 69 | end, 70 | extra_args = { "--metrics", "off", "--exclude", "vendor", "--config", semgrep_rule_folder }, 71 | }, 72 | nls.builtins.diagnostics.vint, 73 | -- Support for nix files 74 | nls.builtins.diagnostics.deadnix, 75 | nls.builtins.diagnostics.statix, 76 | nls.builtins.diagnostics.markdownlint.with { 77 | filetypes = { "markdown" }, 78 | extra_args = { "-r", "~MD013" }, 79 | }, 80 | nls.builtins.diagnostics.vale.with { 81 | filetypes = { "markdown" }, 82 | extra_args = { "--config", vale_config }, 83 | }, 84 | -- nls.builtins.diagnostics.revive.with { 85 | -- condition = function(utils) 86 | -- return utils.root_has_file "revive.toml" or revive_conf 87 | -- end, 88 | -- args = revive_args, 89 | -- diagnostics_postprocess = function(d) 90 | -- d.severity = vim.diagnostic.severity.INFO 91 | -- d.end_col = d.col 92 | -- d.end_row = d.row 93 | -- d.end_lnum = d.lnum 94 | -- end, 95 | -- }, 96 | -- WARN: broken on neovim-head because of `nvim.treesitter.get_node_at_pos` being deprecated 97 | -- nls.builtins.code_actions.gomodifytags, 98 | -- TODO: try these later on 99 | -- nls.builtins.formatting.google_java_format, 100 | -- nls.builtins.code_actions.proselint, 101 | -- nls.builtins.diagnostics.proselint, 102 | -- HACK: using my own version for now 103 | custom_go_actions.gomodifytags, 104 | custom_go_actions.gostructhelper, 105 | custom_md_hover.dictionary, 106 | } 107 | if lvim.builtin.refactoring.active then 108 | table.insert( 109 | sources, 110 | nls.builtins.code_actions.refactoring.with { 111 | filetypes = { "typescript", "javascript", "lua", "c", "cpp", "go", "python", "java", "php" }, 112 | } 113 | ) 114 | end 115 | local ts_found, typescript_code_actions = pcall(require, "typescript.extensions.null-ls.code-actions") 116 | if ts_found then 117 | table.insert(sources, typescript_code_actions) 118 | end 119 | 120 | -- you can either config null-ls itself 121 | nls.setup { 122 | on_attach = require("lvim.lsp").common_on_attach, 123 | debounce = 150, 124 | save_after_format = false, 125 | sources = sources, 126 | } 127 | end 128 | 129 | return M 130 | -------------------------------------------------------------------------------- /lua/user/null_ls/markdown.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | local helpers = require "null-ls.helpers" 3 | local methods = require "null-ls.methods" 4 | local hover = methods.internal.HOVER 5 | 6 | M.dictionary = helpers.make_builtin { 7 | name = "dictionary", 8 | method = hover, 9 | filetypes = { "text", "markdown" }, 10 | generator = { 11 | fn = function(_, done) 12 | local cword = vim.fn.expand "" 13 | local send_definition = function(def) 14 | done { cword .. ": " .. def } 15 | end 16 | 17 | -- If this is a BibTeX citation, don't look it up: 18 | if string.find(cword, "@", 1, true) then 19 | done() 20 | return 21 | end 22 | 23 | require("plenary.curl").request { 24 | url = "https://api.dictionaryapi.dev/api/v2/entries/en/" .. cword, 25 | method = "get", 26 | callback = vim.schedule_wrap(function(data) 27 | if not (data and data.body) then 28 | done() 29 | return 30 | end 31 | 32 | local ok, decoded = pcall(vim.fn.json_decode, data.body) 33 | if not ok or not (decoded and decoded[1]) then 34 | done() 35 | return 36 | end 37 | 38 | send_definition(decoded[1].meanings[1].definitions[1].definition) 39 | end), 40 | } 41 | end, 42 | async = true, 43 | }, 44 | } 45 | 46 | return M 47 | -------------------------------------------------------------------------------- /lua/user/orgmode.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.setup = function() 4 | local status_ok, org_mode = pcall(require, "orgmode") 5 | if not status_ok then 6 | return 7 | end 8 | org_mode.setup { 9 | org_agenda_files = { "~/shared/orgs/**/*" }, 10 | org_default_notes_file = "~/shared/orgs/refile.org", 11 | org_agenda_templates = { 12 | T = { 13 | description = "Todo", 14 | template = "* TODO %?\n DEADLINE: %T", 15 | target = "~/shared/orgs/todos.org", 16 | }, 17 | w = { 18 | description = "Work todo", 19 | template = "* TODO %?\n DEADLINE: %T", 20 | target = "~/shared/orgs/work.org", 21 | }, 22 | }, 23 | mappings = { 24 | global = { 25 | org_agenda = "go", 26 | org_capture = "gC", 27 | }, 28 | }, 29 | } 30 | end 31 | 32 | return M 33 | -------------------------------------------------------------------------------- /lua/user/outline.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local kind = require("user.lsp_kind").cmp_kind 5 | 6 | local status_ok, symout = pcall(require, "outline") 7 | if not status_ok then 8 | return 9 | end 10 | 11 | local opts = { 12 | outline_window = { 13 | position = "right", 14 | width = 20, 15 | relative_width = true, 16 | auto_close = false, 17 | auto_jump = false, 18 | jump_highlight_duration = 300, 19 | center_on_jump = true, 20 | show_numbers = false, 21 | show_relative_numbers = false, 22 | wrap = false, 23 | show_cursorline = true, 24 | hide_cursor = false, 25 | focus_on_open = true, 26 | }, 27 | outline_items = { 28 | show_symbol_details = false, 29 | show_symbol_lineno = false, 30 | }, 31 | symbols = { 32 | icons = { 33 | File = { icon = kind.File, hl = "@text.uri" }, 34 | Module = { icon = kind.Module, hl = "@namespace" }, 35 | Namespace = { icon = kind.Namespace, hl = "@namespace" }, 36 | Package = { icon = kind.Package, hl = "@namespace" }, 37 | Class = { icon = kind.Class, hl = "@type" }, 38 | Method = { icon = kind.Method, hl = "@method" }, 39 | Property = { icon = kind.Property, hl = "@method" }, 40 | Field = { icon = kind.Field, hl = "@field" }, 41 | Constructor = { icon = kind.Constructor, hl = "@constructor" }, 42 | Enum = { icon = kind.Enum, hl = "@type" }, 43 | Interface = { icon = kind.Interface, hl = "@type" }, 44 | Function = { icon = kind.Function, hl = "@function" }, 45 | Variable = { icon = kind.Variable, hl = "@constant" }, 46 | Constant = { icon = kind.Constant, hl = "@constant" }, 47 | String = { icon = kind.String, hl = "@string" }, 48 | Number = { icon = kind.Number, hl = "@number" }, 49 | Boolean = { icon = kind.Boolean, hl = "@boolean" }, 50 | Array = { icon = kind.Array, hl = "@constant" }, 51 | Object = { icon = kind.Object, hl = "@type" }, 52 | Key = { icon = kind.Key, hl = "@type" }, 53 | Null = { icon = kind.Null, hl = "@type" }, 54 | EnumMember = { icon = kind.EnumMember, hl = "@field" }, 55 | Struct = { icon = kind.Struct, hl = "@type" }, 56 | Event = { icon = kind.Event, hl = "@type" }, 57 | Operator = { icon = kind.Operator, hl = "@operator" }, 58 | TypeParameter = { icon = kind.TypeParameter, hl = "@parameter" }, 59 | }, 60 | }, 61 | } 62 | symout.setup(opts) 63 | end 64 | 65 | return M 66 | -------------------------------------------------------------------------------- /lua/user/ovs.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, see = pcall(require, "overseer") 5 | if not status_ok then 6 | return 7 | end 8 | local STATUS = require("overseer.constants").STATUS 9 | 10 | see.setup { 11 | templates = { builtin = true }, 12 | strategy = { "jobstart" }, 13 | task_list = { 14 | bindings = { 15 | dd = "Dispose", 16 | }, 17 | }, 18 | task_launcher = { 19 | bindings = { 20 | n = { 21 | ["c"] = "Cancel", 22 | }, 23 | }, 24 | }, 25 | log = { 26 | { 27 | type = "echo", 28 | level = vim.log.levels.WARN, 29 | }, 30 | { 31 | type = "file", 32 | filename = "overseer.log", 33 | level = vim.log.levels.DEBUG, 34 | }, 35 | }, 36 | component_aliases = { 37 | default = { 38 | "on_output_summarize", 39 | "on_exit_set_status", 40 | { "on_complete_notify", system = "unfocused" }, 41 | "on_complete_dispose", 42 | { "display_duration", detail_level = 2 }, 43 | }, 44 | default_neotest = { 45 | "unique", 46 | { "on_complete_notify", system = "unfocused", on_change = true }, 47 | "default", 48 | }, 49 | }, 50 | actions = { 51 | ["keep runnning"] = { 52 | desc = "restart the task even if it succeeds", 53 | run = function(task) 54 | task:add_components { { "on_complete_restart", statuses = { STATUS.FAILURE, STATUS.SUCCESS } } } 55 | if task.status == STATUS.FAILURE or task.status == STATUS.SUCCESS then 56 | task:restart() 57 | end 58 | end, 59 | }, 60 | ["don't dispose"] = { 61 | desc = "keep the task until manually disposed", 62 | run = function(task) 63 | task:remove_components { "on_complete_dispose" } 64 | end, 65 | }, 66 | }, 67 | } 68 | end 69 | 70 | return M 71 | -------------------------------------------------------------------------------- /lua/user/peek.lua: -------------------------------------------------------------------------------- 1 | local M = { 2 | floating_buf = nil, 3 | floating_win = nil, 4 | prev_result = nil, 5 | } 6 | 7 | local function create_floating_file(location, opts) 8 | vim.validate { 9 | location = { location, "t" }, 10 | opts = { opts, "t", true }, 11 | } 12 | 13 | -- Set some defaults 14 | opts = opts or {} 15 | local close_events = opts.close_events or { "CursorMoved", "CursorMovedI", "BufHidden", "InsertCharPre" } 16 | 17 | -- location may be LocationLink or Location 18 | local uri = location.targetUri or location.uri 19 | if uri == nil then 20 | return 21 | end 22 | local bufnr = vim.uri_to_bufnr(uri) 23 | if not vim.api.nvim_buf_is_loaded(bufnr) then 24 | vim.fn.bufload(bufnr) 25 | end 26 | 27 | local range = location.targetRange or location.range 28 | 29 | local contents = vim.api.nvim_buf_get_lines( 30 | bufnr, 31 | range.start.line, 32 | math.min(range["end"].line + 1 + (opts.context or 15), range.start.line + (opts.max_height or 15)), 33 | false 34 | ) 35 | if next(contents) == nil then 36 | vim.notify("peek: Unable to get contents of the file!", vim.log.levels.WARN) 37 | return 38 | end 39 | local width, height = vim.lsp.util._make_floating_popup_size(contents, opts) 40 | local if_nil = vim.F.if_nil 41 | opts = vim.lsp.util.make_floating_popup_options(if_nil(width, 30), if_nil(height, 15), opts) 42 | -- Don't make it minimal as it is meant to be fully featured 43 | opts["style"] = nil 44 | 45 | vim.api.nvim_set_option_value("bufhidden", "wipe", { buf = bufnr }) 46 | 47 | local winnr = vim.api.nvim_open_win(bufnr, false, opts) 48 | vim.api.nvim_set_option_value("winblend", 0, { win = 0, scope = "local" }) 49 | 50 | vim.api.nvim_win_set_cursor(winnr, { range.start.line + 1, range.start.character }) 51 | vim.api.nvim_buf_set_var(bufnr, "lsp_floating_window", winnr) 52 | 53 | -- Set some autocmds to close the window 54 | vim.api.nvim_command( 55 | string.format("autocmd %s ++once lua pcall(vim.api.nvim_win_close, %d, true)", unpack(close_events), winnr) 56 | ) 57 | 58 | return bufnr, winnr 59 | end 60 | 61 | local function preview_location_callback(result) 62 | if result == nil or vim.tbl_isempty(result) then 63 | return nil 64 | end 65 | 66 | local opts = { 67 | border = "rounded", 68 | context = 10, 69 | } 70 | 71 | if vim.islist(result) then 72 | M.prev_result = result[1] 73 | M.floating_buf, M.floating_win = create_floating_file(result[1], opts) 74 | else 75 | M.prev_result = result 76 | M.floating_buf, M.floating_win = create_floating_file(result, opts) 77 | end 78 | end 79 | 80 | local function preview_location_callback_new_signature(_, result) 81 | return preview_location_callback(result) 82 | end 83 | 84 | function M.open_file() 85 | -- Get the file currently open in the floating window 86 | local filepath = vim.fn.expand "%:." 87 | 88 | if not filepath then 89 | vim.notify("peek: Unable to open the file!", vim.log.levels.ERROR) 90 | return 91 | end 92 | 93 | -- Close the floating window 94 | pcall(vim.api.nvim_win_close, M.floating_win, true) 95 | 96 | -- Edit the file 97 | vim.cmd("edit " .. filepath) 98 | 99 | local winnr = vim.api.nvim_get_current_win() 100 | 101 | -- Set the cursor at the right position 102 | M.set_cursor_to_prev_pos(winnr) 103 | end 104 | 105 | function M.set_cursor_to_prev_pos(winnr) 106 | -- Get position of the thing to peek at 107 | local location = M.prev_result 108 | local range = location.targetRange or location.range 109 | local cursor_pos = { range.start.line + 1, range.start.character } 110 | 111 | -- Set the winnr to the floating window if none was passed in 112 | winnr = winnr or M.floating_win 113 | -- Set the cursor at the correct position in the floating window 114 | vim.api.nvim_win_set_cursor(winnr, cursor_pos) 115 | end 116 | 117 | function M.Peek(what) 118 | -- If a window already exists, focus it at the right position! 119 | if vim.tbl_contains(vim.api.nvim_list_wins(), M.floating_win) then 120 | local success_1, _ = pcall(vim.api.nvim_set_current_win, M.floating_win) 121 | if not success_1 then 122 | vim.notify("peek: You cannot edit the current file in a preview!", vim.log.levels.ERROR) 123 | return 124 | end 125 | 126 | -- Set the cursor at the correct position in the floating window 127 | M.set_cursor_to_prev_pos() 128 | 129 | vim.api.nvim_buf_set_keymap( 130 | M.floating_buf, 131 | "n", 132 | "", 133 | ":lua require('user.peek').open_file()", 134 | { noremap = true, silent = true } 135 | ) 136 | else 137 | -- Make a new request and then create the new window in the callback 138 | local params = vim.lsp.util.make_position_params(0, "utf-16") 139 | local preview_callback = preview_location_callback_new_signature 140 | local success, _ = pcall(vim.lsp.buf_request, 0, "textDocument/" .. what, params, preview_callback) 141 | if not success then 142 | vim.notify( 143 | 'peek: Error calling LSP method "textDocument/' .. what .. '". The current language lsp might not support it.', 144 | vim.log.levels.ERROR 145 | ) 146 | end 147 | end 148 | end 149 | 150 | return M 151 | -------------------------------------------------------------------------------- /lua/user/persist.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local opt = { 5 | save_dir = vim.fn.expand(get_cache_dir() .. "/sessions/"), -- directory where session files are saved 6 | silent = false, -- silent nvim message when sourcing session file 7 | use_git_branch = true, -- create session files based on the branch of the git enabled repository 8 | autosave = true, -- automatically save session files when exiting Neovim 9 | should_autosave = function() 10 | if vim.bo.filetype == "alpha" then 11 | return false 12 | end 13 | return true 14 | end, -- function to determine if a session should be autosaved 15 | -- Set `lazy = false` in `plugins/editor.lua` to enable this 16 | autoload = false, -- automatically load the session for the cwd on Neovim startup 17 | on_autoload_no_session = nil, -- function to run when `autoload = true` but there is no session to load 18 | follow_cwd = true, -- change session file name to match current working directory if it changes 19 | allowed_dirs = nil, -- table of dirs that the plugin will auto-save and auto-load from 20 | ignored_dirs = nil, -- table of dirs that are ignored when auto-saving and auto-loading 21 | telescope = { -- options for the telescope extension 22 | reset_prompt_after_deletion = true, -- whether to reset prompt after session deleted 23 | }, 24 | } 25 | require("persisted").setup(opt) 26 | end 27 | 28 | return M 29 | -------------------------------------------------------------------------------- /lua/user/presence.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, presence = pcall(require, "presence") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | presence:setup { 10 | auto_update = true, 11 | neovim_image_text = "LunarVim to the moon", 12 | main_image = "file", 13 | client_id = "793271441293967371", 14 | log_level = nil, 15 | debounce_timeout = 10, 16 | enable_line_number = true, -- Displays the current line number instead of the current project 17 | editing_text = "Editing %s", -- string rendered when an editable file is loaded in the buffer 18 | file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer 19 | git_commit_text = "Committing changes", -- string rendered when commiting changes in git 20 | plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins 21 | reading_text = "Reading %s", -- string rendered when a read-only file is loaded in the buffer 22 | workspace_text = "Working on %s", -- Workspace format string (either string or function(git_project_name: string|nil, buffer: string): string) 23 | line_number_text = "Line %s out of %s", -- Line number string (for when enable_line_number is set to true) 24 | } 25 | end 26 | 27 | return M 28 | -------------------------------------------------------------------------------- /lua/user/project.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local ok, pj = pcall(require, "project_nvim") 5 | if not ok then 6 | return 7 | end 8 | pj.setup { 9 | detection_methods = { "lsp", "pattern" }, 10 | patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", "pom.xml" }, 11 | datapath = get_cache_dir(), 12 | } 13 | end 14 | 15 | return M 16 | -------------------------------------------------------------------------------- /lua/user/rust_tools.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local opts = { 5 | tools = { 6 | executor = require "rustaceanvim.executors.termopen", -- can be quickfix or termopen 7 | reload_workspace_from_cargo_toml = true, 8 | inlay_hints = { 9 | auto = true, 10 | only_current_line = false, 11 | show_parameter_hints = true, 12 | parameter_hints_prefix = "<-", 13 | other_hints_prefix = "=>", 14 | max_len_align = false, 15 | max_len_align_padding = 1, 16 | right_align = false, 17 | right_align_padding = 7, 18 | highlight = "Comment", 19 | }, 20 | hover_actions = { 21 | border = { 22 | { "╭", "FloatBorder" }, 23 | { "─", "FloatBorder" }, 24 | { "╮", "FloatBorder" }, 25 | { "│", "FloatBorder" }, 26 | { "╯", "FloatBorder" }, 27 | { "─", "FloatBorder" }, 28 | { "╰", "FloatBorder" }, 29 | { "│", "FloatBorder" }, 30 | }, 31 | auto_focus = true, 32 | }, 33 | }, 34 | server = { 35 | on_attach = function(client, bufnr) 36 | require("lvim.lsp").common_on_attach(client, bufnr) 37 | end, 38 | on_init = require("lvim.lsp").common_on_init, 39 | capabilities = require("lvim.lsp").common_capabilities(), 40 | default_settings = { 41 | ["rust-analyzer"] = { 42 | inlayHints = { locationLinks = false }, 43 | lens = { 44 | enable = true, 45 | }, 46 | checkOnSave = { 47 | enable = true, 48 | command = "clippy", 49 | }, 50 | diagnostics = { 51 | experimental = true, 52 | }, 53 | }, 54 | }, 55 | }, 56 | } 57 | local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/packages/codelldb/extension/") 58 | local vscode_path = vim.fn.expand "~/" .. ".vscode/extensions/vadimcn.vscode-lldb-1.10.0/" 59 | 60 | local path = "" 61 | local debugger_found = true 62 | if M.dir_exists(mason_path) then 63 | path = mason_path 64 | elseif M.dir_exists(vscode_path) then 65 | path = vscode_path 66 | else 67 | debugger_found = false 68 | vim.notify("please install codelldb using :Mason or via vscode", vim.log.levels.WARN) 69 | end 70 | 71 | if debugger_found then 72 | local codelldb_path = path .. "adapter/codelldb" 73 | local liblldb_path = path .. "lldb/lib/liblldb.so" 74 | 75 | if vim.fn.has "mac" == 1 then 76 | liblldb_path = path .. "lldb/lib/liblldb.dylib" 77 | end 78 | 79 | if vim.fn.filereadable(codelldb_path) and vim.fn.filereadable(liblldb_path) then 80 | local cfg = require "rustaceanvim.config" 81 | opts.dap = { 82 | adapter = cfg.get_codelldb_adapter(codelldb_path, liblldb_path), 83 | } 84 | else 85 | vim.notify("please reinstall codellb, i cannot find liblldb or codelldb itself", vim.log.levels.WARN) 86 | end 87 | end 88 | vim.g.rustaceanvim = function() 89 | return opts 90 | end 91 | end 92 | 93 | M.dir_exists = function(file) 94 | local ok, _, code = os.rename(file, file) 95 | if not ok then 96 | if code == 13 then 97 | -- Permission denied, but it exists 98 | return true 99 | end 100 | end 101 | return ok 102 | end 103 | 104 | return M 105 | -------------------------------------------------------------------------------- /lua/user/sidebar.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, sidebar = pcall(require, "sidebar-nvim") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | sidebar.setup { 10 | open = false, 11 | initial_width = 30, 12 | enable_profile = false, 13 | sections = { "datetime", "git", "diagnostics", "containers" }, 14 | datetime = { 15 | icon = "󰃰", 16 | format = "%a %b %d, %H:%M", 17 | clocks = { 18 | { name = "local" }, 19 | }, 20 | }, 21 | todos = { 22 | icon = "", 23 | ignored_paths = { "~" }, -- ignore certain paths, this will prevent huge folders like $HOME to hog Neovim with TODO searching 24 | initially_closed = false, -- whether the groups should be initially closed on start. You can manually open/close groups later. 25 | }, 26 | } 27 | end 28 | 29 | return M 30 | -------------------------------------------------------------------------------- /lua/user/spectre.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, spectre = pcall(require, "spectre") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | local sed_args = nil 10 | if vim.fn.has "mac" == 1 then 11 | sed_args = { "-I", "" } 12 | end 13 | 14 | spectre.setup { 15 | 16 | color_devicons = true, 17 | highlight = { 18 | ui = "String", 19 | search = "DiffChange", 20 | replace = "DiffDelete", 21 | }, 22 | mapping = { 23 | ["toggle_line"] = { 24 | map = "t", 25 | cmd = "lua require('spectre').toggle_line()", 26 | desc = "toggle current item", 27 | }, 28 | ["enter_file"] = { 29 | map = "", 30 | cmd = "lua require('spectre.actions').select_entry()", 31 | desc = "goto current file", 32 | }, 33 | ["send_to_qf"] = { 34 | map = "Q", 35 | cmd = "lua require('spectre.actions').send_to_qf()", 36 | desc = "send all item to quickfix", 37 | }, 38 | ["replace_cmd"] = { 39 | map = "c", 40 | cmd = "lua require('spectre.actions').replace_cmd()", 41 | desc = "input replace vim command", 42 | }, 43 | ["show_option_menu"] = { 44 | map = "o", 45 | cmd = "lua require('spectre').show_options()", 46 | desc = "show option", 47 | }, 48 | ["run_replace"] = { 49 | map = "R", 50 | cmd = "lua require('spectre.actions').run_replace()", 51 | desc = "replace all", 52 | }, 53 | ["change_view_mode"] = { 54 | map = "m", 55 | cmd = "lua require('spectre').change_view()", 56 | desc = "change result view mode", 57 | }, 58 | ["toggle_ignore_case"] = { 59 | map = "I", 60 | cmd = "lua require('spectre').change_options('ignore-case')", 61 | desc = "toggle ignore case", 62 | }, 63 | ["toggle_ignore_hidden"] = { 64 | map = "H", 65 | cmd = "lua require('spectre').change_options('hidden')", 66 | desc = "toggle search hidden", 67 | }, 68 | }, 69 | find_engine = { 70 | ["rg"] = { 71 | cmd = "rg", 72 | args = { 73 | "--color=never", 74 | "--no-heading", 75 | "--with-filename", 76 | "--line-number", 77 | "--column", 78 | }, 79 | options = { 80 | ["ignore-case"] = { 81 | value = "--ignore-case", 82 | icon = "[I]", 83 | desc = "ignore case", 84 | }, 85 | ["hidden"] = { 86 | value = "--hidden", 87 | desc = "hidden file", 88 | icon = "[H]", 89 | }, 90 | }, 91 | }, 92 | ["ag"] = { 93 | cmd = "ag", 94 | args = { 95 | "--vimgrep", 96 | "-s", 97 | }, 98 | options = { 99 | ["ignore-case"] = { 100 | value = "-i", 101 | icon = "[I]", 102 | desc = "ignore case", 103 | }, 104 | ["hidden"] = { 105 | value = "--hidden", 106 | desc = "hidden file", 107 | icon = "[H]", 108 | }, 109 | }, 110 | }, 111 | }, 112 | replace_engine = { 113 | ["sed"] = { 114 | cmd = "sed", 115 | args = sed_args, 116 | }, 117 | options = { 118 | ["ignore-case"] = { 119 | value = "--ignore-case", 120 | icon = "[I]", 121 | desc = "ignore case", 122 | }, 123 | }, 124 | }, 125 | default = { 126 | find = { 127 | cmd = "rg", 128 | options = { "ignore-case" }, 129 | }, 130 | replace = { 131 | cmd = "sed", 132 | }, 133 | }, 134 | replace_vim_cmd = "cdo", 135 | is_open_target_win = true, --open file on opener window 136 | is_insert_mode = false, -- start open panel on is_insert_mode 137 | } 138 | end 139 | 140 | return M 141 | -------------------------------------------------------------------------------- /lua/user/symbol_use.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, sym = pcall(require, "symbol-usage") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | local text_format = function(symbol) 10 | local res = {} 11 | local ins = table.insert 12 | 13 | local round_start = { "", "SymbolUsageRounding" } 14 | local round_end = { "", "SymbolUsageRounding" } 15 | 16 | if symbol.references then 17 | local usage = symbol.references <= 1 and "usage" or "usages" 18 | local num = symbol.references == 0 and "no" or symbol.references 19 | ins(res, round_start) 20 | ins(res, { "󰌹 ", "SymbolUsageRef" }) 21 | ins(res, { ("%s %s"):format(num, usage), "SymbolUsageContent" }) 22 | ins(res, round_end) 23 | end 24 | 25 | if symbol.definition then 26 | if #res > 0 then 27 | table.insert(res, { " ", "NonText" }) 28 | end 29 | ins(res, round_start) 30 | ins(res, { "󰳽 ", "SymbolUsageDef" }) 31 | ins(res, { symbol.definition .. " defs", "SymbolUsageContent" }) 32 | ins(res, round_end) 33 | end 34 | 35 | if symbol.implementation then 36 | if #res > 0 then 37 | table.insert(res, { " ", "NonText" }) 38 | end 39 | ins(res, round_start) 40 | ins(res, { "󰡱 ", "SymbolUsageImpl" }) 41 | ins(res, { symbol.implementation .. " impls", "SymbolUsageContent" }) 42 | ins(res, round_end) 43 | end 44 | 45 | return res 46 | end 47 | sym.setup { 48 | text_format = text_format, 49 | references = { enabled = true, include_declaration = false }, 50 | definition = { enabled = true }, 51 | implementation = { enabled = true }, 52 | } 53 | end 54 | 55 | return M 56 | -------------------------------------------------------------------------------- /lua/user/symbols_outline.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local kind = require("user.lsp_kind").cmp_kind 5 | 6 | local status_ok, symout = pcall(require, "symbols-outline") 7 | if not status_ok then 8 | return 9 | end 10 | 11 | local opts = { 12 | highlight_hovered_item = true, 13 | show_guides = true, 14 | auto_preview = false, 15 | position = "right", 16 | relative_width = true, 17 | width = 20, 18 | show_numbers = false, 19 | show_relative_numbers = false, 20 | show_symbol_details = false, 21 | preview_bg_highlight = "Pmenu", 22 | keymaps = { -- These keymaps can be a string or a table for multiple keys 23 | close = { "", "q" }, 24 | goto_location = "", 25 | focus_location = "o", 26 | hover_symbol = "", 27 | toggle_preview = "K", 28 | rename_symbol = "r", 29 | code_actions = "a", 30 | }, 31 | lsp_blacklist = {}, 32 | symbol_blacklist = {}, 33 | symbols = { 34 | File = { icon = kind.File, hl = "@text.uri" }, 35 | Module = { icon = kind.Module, hl = "@namespace" }, 36 | Namespace = { icon = kind.Namespace, hl = "@namespace" }, 37 | Package = { icon = kind.Package, hl = "@namespace" }, 38 | Class = { icon = kind.Class, hl = "@type" }, 39 | Method = { icon = kind.Method, hl = "@method" }, 40 | Property = { icon = kind.Property, hl = "@method" }, 41 | Field = { icon = kind.Field, hl = "@field" }, 42 | Constructor = { icon = kind.Constructor, hl = "@constructor" }, 43 | Enum = { icon = kind.Enum, hl = "@type" }, 44 | Interface = { icon = kind.Interface, hl = "@type" }, 45 | Function = { icon = kind.Function, hl = "@function" }, 46 | Variable = { icon = kind.Variable, hl = "@constant" }, 47 | Constant = { icon = kind.Constant, hl = "@constant" }, 48 | String = { icon = kind.String, hl = "@string" }, 49 | Number = { icon = kind.Number, hl = "@number" }, 50 | Boolean = { icon = kind.Boolean, hl = "@boolean" }, 51 | Array = { icon = kind.Array, hl = "@constant" }, 52 | Object = { icon = kind.Object, hl = "@type" }, 53 | Key = { icon = kind.Key, hl = "@type" }, 54 | Null = { icon = kind.Null, hl = "@type" }, 55 | EnumMember = { icon = kind.EnumMember, hl = "@field" }, 56 | Struct = { icon = kind.Struct, hl = "@type" }, 57 | Event = { icon = kind.Event, hl = "@type" }, 58 | Operator = { icon = kind.Operator, hl = "@operator" }, 59 | TypeParameter = { icon = kind.TypeParameter, hl = "@parameter" }, 60 | }, 61 | } 62 | 63 | symout.setup(opts) 64 | end 65 | 66 | return M 67 | -------------------------------------------------------------------------------- /lua/user/tabout.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, tabout = pcall(require, "tabout") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | tabout.setup { 10 | completion = false, 11 | ignore_beginning = false, 12 | tabouts = { 13 | { open = "'", close = "'" }, 14 | { open = '"', close = '"' }, 15 | { open = "`", close = "`" }, 16 | { open = "(", close = ")" }, 17 | { open = "[", close = "]" }, 18 | { open = "{", close = "}" }, 19 | }, 20 | } 21 | end 22 | 23 | return M 24 | -------------------------------------------------------------------------------- /lua/user/tex.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.init = function() 4 | vim.g.vimtex_view_enabled = true 5 | vim.g.vimtex_compiler_method = "latexmk" 6 | vim.g.vimtex_view_method = lvim.builtin.latex.view_method 7 | if lvim.builtin.latex.view_method == "skim" then 8 | vim.g.vimtex_view_skim_activate = 1 9 | vim.g.vimtex_view_skim_reading_bar = 0 10 | end 11 | if lvim.builtin.latex.rtl_support then 12 | vim.g.vimtex_compiler_latexmk_engines = { 13 | _ = "-xelatex", 14 | pdflatex = "-pdf", 15 | dvipdfex = "-pdfdvi", 16 | lualatex = "-lualatex", 17 | xelatex = "-xelatex", 18 | } 19 | vim.g.vimtex_compiler_latexrun_engines = { 20 | _ = "xelatex", 21 | pdflatex = "pdflatex", 22 | lualatex = "lualatex", 23 | xelatex = "xelatex", 24 | } 25 | end 26 | vim.g.tex_flavor = "latex" 27 | vim.g.vimtex_fold_enabled = 0 28 | vim.g.vimtex_quickfix_ignore_filters = {} 29 | end 30 | 31 | M.config = function() 32 | vim.cmd [[ 33 | augroup vimtex_event_1 34 | au! 35 | au User VimtexEventQuit VimtexClean 36 | au User VimtexEventInitPost VimtexCompile 37 | augroup END 38 | ]] 39 | local latexmk_args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" } 40 | if lvim.builtin.latex.rtl_support then 41 | latexmk_args = { "-xelatex", "-file-line-error", "-interaction=nonstopmode", "-synctex=1", "%f" } 42 | end 43 | local tex_preview_settings = {} 44 | local forward_search_executable = lvim.builtin.latex.preview_exec 45 | 46 | local sumatrapdf_args = { "-reuse-instance", "%p", "-forward-search", "%f", "%l" } 47 | local evince_args = { "-f", "%l", "%p", '"code -g %f:%l"' } 48 | local okular_args = { "--unique", "file:%p#src:%l%f" } 49 | local zathura_args = { "--synctex-forward", "%l:1:%f", "%p" } 50 | local qpdfview_args = { "--unique", "%p#src:%f:%l:1" } 51 | local skim_args = { "%l", "%p", "%f" } 52 | 53 | if forward_search_executable == "C:/Users/{User}/AppData/Local/SumatraPDF/SumatraPDF.exe" then 54 | tex_preview_settings = sumatrapdf_args 55 | elseif forward_search_executable == "evince-synctex" then 56 | tex_preview_settings = evince_args 57 | elseif forward_search_executable == "okular" then 58 | tex_preview_settings = okular_args 59 | elseif forward_search_executable == "zathura" then 60 | tex_preview_settings = zathura_args 61 | elseif forward_search_executable == "qpdfview" then 62 | tex_preview_settings = qpdfview_args 63 | elseif forward_search_executable == "/Applications/Skim.app/Contents/SharedSupport/displayline" then 64 | tex_preview_settings = skim_args 65 | end 66 | return { 67 | cmd = { vim.fn.stdpath "data" .. "/mason/packages/texlab/texlab" }, 68 | filetypes = { "tex", "bib" }, 69 | root_dir = function(fname) 70 | return require("lspconfig").util.path.dirname(fname) 71 | end, 72 | settings = { 73 | texlab = { 74 | auxDirectory = nil, 75 | bibtexFormatter = "texlab", 76 | build = { 77 | executable = "latexmk", 78 | args = latexmk_args, 79 | on_save = false, 80 | forward_search_after = false, 81 | }, 82 | chktex = { 83 | on_open_and_save = false, 84 | on_edit = false, 85 | }, 86 | forward_search = { 87 | executable = nil, 88 | args = {}, 89 | }, 90 | latexindent = { 91 | ["local"] = nil, 92 | modify_line_breaks = false, 93 | }, 94 | linters = { "chktex" }, 95 | auto_save = false, 96 | ignore_errors = {}, 97 | diagnosticsDelay = 300, 98 | formatterLineLength = 120, 99 | forwardSearch = { 100 | args = tex_preview_settings, 101 | executable = forward_search_executable, 102 | }, 103 | latexFormatter = "latexindent", 104 | }, 105 | }, 106 | } 107 | end 108 | 109 | return M 110 | -------------------------------------------------------------------------------- /lua/user/todo_comments.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, todo = pcall(require, "todo-comments") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | local icons = require("user.lsp_kind").todo_comments 10 | todo.setup { 11 | keywords = { 12 | FIX = { icon = icons.FIX }, 13 | TODO = { icon = icons.TODO, alt = { "WIP" } }, 14 | HACK = { icon = icons.HACK, color = "hack" }, 15 | WARN = { icon = icons.WARN }, 16 | PERF = { icon = icons.PERF }, 17 | NOTE = { icon = icons.NOTE, alt = { "INFO", "NB" } }, 18 | ERROR = { icon = icons.ERROR, color = "error", alt = { "ERR" } }, 19 | REFS = { icon = icons.REFS }, 20 | SAFETY = { icon = icons.SHIELD, color = "hint" }, 21 | audit = { icon = icons.WARN, color = "warning" }, 22 | -- auditissue = { icon = icons.ERROR, color = "error", alt = { "audit-issue" } }, 23 | -- auditinfo = { icon = icons.NOTE, color = "hint", alt = { "audit-info" } }, 24 | }, 25 | highlight = { 26 | max_line_len = 120, 27 | pattern = { [[.*<(KEYWORDS)\s*:]], [[\/\/.+(audit)\s+]] }, 28 | }, 29 | colors = { 30 | error = { "DiagnosticError" }, 31 | warning = { "DiagnosticWarn" }, 32 | info = { "DiagnosticInfo" }, 33 | hint = { "DiagnosticHint" }, 34 | hack = { "Function" }, 35 | ref = { "FloatBorder" }, 36 | default = { "Identifier" }, 37 | }, 38 | } 39 | end 40 | 41 | return M 42 | -------------------------------------------------------------------------------- /lua/user/troubl.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, trbl = pcall(require, "trouble") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | trbl.setup { 10 | focus = true, 11 | preview = { 12 | type = "float", 13 | relative = "editor", 14 | border = "rounded", 15 | title = "Preview", 16 | title_pos = "center", 17 | position = { 0, -2 }, 18 | size = { width = 0.4, height = 0.3 }, 19 | zindex = 200, 20 | }, 21 | } 22 | 23 | if lvim.transparent_window then 24 | vim.cmd [[ hi! TroubleNormal guibg=NONE ]] 25 | vim.cmd [[ hi! TroubleNormalNC guibg=NONE ]] 26 | end 27 | end 28 | 29 | return M 30 | -------------------------------------------------------------------------------- /lua/user/tss.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local api = vim.api 4 | 5 | local get_map_options = function(custom_options) 6 | local options = { silent = true } 7 | if custom_options then 8 | options = vim.tbl_extend("force", options, custom_options) 9 | end 10 | return options 11 | end 12 | 13 | M.map = function(mode, target, source, opts) 14 | vim.keymap.set(mode, target, source, get_map_options(opts)) 15 | end 16 | 17 | for _, mode in ipairs { "n", "o", "i", "x", "t", "c" } do 18 | M[mode .. "map"] = function(...) 19 | M.map(mode, ...) 20 | end 21 | end 22 | 23 | M.buf_map = function(bufnr, mode, target, source, opts) 24 | opts = opts or {} 25 | opts.buffer = bufnr 26 | 27 | M.map(mode, target, source, get_map_options(opts)) 28 | end 29 | 30 | M.t = function(str) 31 | return vim.api.nvim_replace_termcodes(str, true, true, true) 32 | end 33 | 34 | M.input = function(keys, mode) 35 | api.nvim_feedkeys(M.t(keys), mode or "m", true) 36 | end 37 | 38 | M.warn = function(msg) 39 | api.nvim_echo({ { msg, "WarningMsg" } }, true, {}) 40 | end 41 | 42 | M.gfind = function(str, substr, cb, init) 43 | init = init or 1 44 | local start_pos, end_pos = str:find(substr, init) 45 | if start_pos then 46 | cb(start_pos, end_pos) 47 | return M.gfind(str, substr, cb, end_pos + 1) 48 | end 49 | end 50 | 51 | -- const myString = "hello ${}" -> 52 | -- const myString = `hello ${}` 53 | local change_template_string_quotes = function() 54 | local row, col = unpack(api.nvim_win_get_cursor(0)) 55 | row = row - 1 56 | 57 | local quote_start, quote_end 58 | M.gfind(api.nvim_get_current_line(), "[\"']", function(pos) 59 | if not quote_start then 60 | -- start at first quote 61 | quote_start = pos 62 | elseif pos < col then 63 | -- move start if quote is closer to col 64 | if (pos - col) > (quote_start - col) then 65 | quote_start = pos 66 | end 67 | elseif not quote_end then 68 | -- first quote after col is end 69 | quote_end = pos 70 | end 71 | end) 72 | 73 | -- if found, replace quotes with backticks 74 | if quote_start and quote_start <= col and quote_end then 75 | api.nvim_buf_set_text(0, row, quote_start - 1, row, quote_start, { "`" }) 76 | api.nvim_buf_set_text(0, row, quote_end - 1, row, quote_end, { "`" }) 77 | end 78 | 79 | -- input and move cursor into pair 80 | M.input("${}", "n") 81 | M.input "" 82 | end 83 | 84 | -- padding: 40px; -> 85 | -- padding: "40px", 86 | local css_to_js = function(opts) 87 | local start_line, end_line 88 | if type(opts) == "table" then 89 | -- called via command 90 | start_line, end_line = opts.line1 - 1, opts.line2 91 | else 92 | -- called as operator 93 | start_line = api.nvim_buf_get_mark(0, "[")[1] - 1 94 | end_line = api.nvim_buf_get_mark(0, "]")[1] + 1 95 | end 96 | 97 | local did_convert = false 98 | for i, line in ipairs(api.nvim_buf_get_lines(0, start_line, end_line, false)) do 99 | -- if the line ends in a comma, it's probably already js 100 | if line:sub(#line) == "," then 101 | goto continue 102 | end 103 | -- ignore comments 104 | if line:find "%/%*" then 105 | goto continue 106 | end 107 | 108 | local indentation, name, val = line:match "(%s+)(.+):%s(.+)" 109 | -- skip non-matching lines 110 | if not (name and val) then 111 | goto continue 112 | end 113 | 114 | local parsed_name = "" 115 | for j, component in ipairs(vim.split(name, "-")) do 116 | parsed_name = parsed_name .. (j == 1 and component or (component:sub(1, 1):upper() .. component:sub(2))) 117 | end 118 | 119 | local parsed_val = val:gsub(";", "") 120 | -- keep numbers, wrap others in quotes 121 | parsed_val = tonumber(parsed_val) or string.format('"%s"', parsed_val) 122 | local parsed_line = table.concat { indentation, parsed_name, ": ", parsed_val, "," } 123 | 124 | did_convert = true 125 | local row = start_line + i 126 | api.nvim_buf_set_lines(0, row - 1, row, false, { parsed_line }) 127 | 128 | ::continue:: 129 | end 130 | 131 | if not did_convert then 132 | M.warn "css-to-js: nothing to convert" 133 | end 134 | end 135 | 136 | _G.css_to_js = css_to_js 137 | 138 | local function on_attach(client, bufnr) 139 | client.server_capabilities.documentFormattingProvider = false 140 | client.server_capabilities.documentRangeFormattingProvider = false 141 | require("lvim.lsp").common_on_attach(client, bufnr) 142 | api.nvim_buf_create_user_command(bufnr, "CssToJs", css_to_js, { range = true }) 143 | M.buf_map(bufnr, "i", "${", change_template_string_quotes, { nowait = true }) 144 | M.buf_map(bufnr, "n", "gx", ":set opfunc=v:lua.css_to_jsg@") 145 | M.buf_map(bufnr, "n", "gxx", ":CssToJs") 146 | M.buf_map(bufnr, "v", "gx", ":CssToJs") 147 | end 148 | 149 | M.config = function() 150 | local status_ok, ts = pcall(require, "typescript") 151 | if not status_ok then 152 | return 153 | end 154 | 155 | local ok, lvim_lsp = pcall(require, "lvim.lsp") 156 | if not ok then 157 | return 158 | end 159 | 160 | ts.setup { 161 | disable_commands = false, -- prevent the plugin from creating Vim commands 162 | disable_formatting = false, -- disable tsserver's formatting capabilities 163 | debug = false, -- enable debug logging for commands 164 | server = { -- pass options to lspconfig's setup method 165 | settings = { 166 | typescript = { 167 | inlayHints = { 168 | includeInlayParameterNameHints = "all", 169 | includeInlayParameterNameHintsWhenArgumentMatchesName = false, 170 | includeInlayFunctionParameterTypeHints = true, 171 | includeInlayVariableTypeHints = true, 172 | includeInlayPropertyDeclarationTypeHints = true, 173 | includeInlayFunctionLikeReturnTypeHints = true, 174 | includeInlayEnumMemberValueHints = true, 175 | }, 176 | }, 177 | javascript = { 178 | inlayHints = { 179 | includeInlayParameterNameHints = "all", 180 | includeInlayParameterNameHintsWhenArgumentMatchesName = false, 181 | includeInlayFunctionParameterTypeHints = true, 182 | includeInlayVariableTypeHints = true, 183 | includeInlayPropertyDeclarationTypeHints = true, 184 | includeInlayFunctionLikeReturnTypeHints = true, 185 | includeInlayEnumMemberValueHints = true, 186 | }, 187 | }, 188 | }, 189 | on_attach = on_attach, 190 | capabilities = lvim_lsp.common_capabilities(), 191 | }, 192 | } 193 | end 194 | 195 | return M 196 | -------------------------------------------------------------------------------- /lua/user/twilight.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, twilight = pcall(require, "twilight") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | twilight.setup { 10 | dimming = { 11 | alpha = 0.25, -- amount of dimming 12 | color = { "Normal", "#ffffff" }, 13 | }, 14 | context = 15, 15 | expand = { 16 | "function", 17 | "method", 18 | "table", 19 | "if_statement", 20 | }, 21 | exclude = {}, 22 | } 23 | end 24 | 25 | return M 26 | -------------------------------------------------------------------------------- /lua/user/typtools.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, tools = pcall(require, "typescript-tools") 5 | if not status_ok then 6 | return 7 | end 8 | local ok, lvim_lsp = pcall(require, "lvim.lsp") 9 | if not ok then 10 | return 11 | end 12 | local opts = { 13 | capabilities = lvim_lsp.common_capabilities(), 14 | on_attach = function(client, bufnr) 15 | client.server_capabilities.documentFormattingProvider = false 16 | client.server_capabilities.documentRangeFormattingProvider = false 17 | 18 | lvim_lsp.common_on_attach(client, bufnr) 19 | end, 20 | settings = { 21 | separate_diagnostic_server = true, 22 | composite_mode = "separate_diagnostic", 23 | publish_diagnostic_on = "insert_leave", 24 | -- tsserver_logs = "verbose", 25 | tsserver_file_preferences = { 26 | importModuleSpecifierPreference = "non-relative", 27 | }, 28 | tsserver_locale = "en", 29 | -- mirror of VSCode's `typescript.suggest.completeFunctionCalls` 30 | complete_function_calls = false, 31 | include_completions_with_insert_text = true, 32 | -- WARNING: Experimental feature also in VSCode, because it might hit performance of server. 33 | -- possible values: ("off"|"all"|"implementations_only"|"references_only") 34 | code_lens = "off", 35 | disable_member_code_lens = true, 36 | -- JSXCloseTag 37 | -- WARNING: it is disabled by default (maybe you configuration or distro already uses nvim-ts-autotag, 38 | -- that maybe have a conflict if enable this feature. ) 39 | jsx_close_tag = { 40 | enable = false, 41 | filetypes = { "javascriptreact", "typescriptreact" }, 42 | }, 43 | }, 44 | } 45 | tools.setup(opts) 46 | end 47 | 48 | return M 49 | -------------------------------------------------------------------------------- /lua/user/vim_test.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local t = require "toggleterm" 5 | local terms = require "toggleterm.terminal" 6 | 7 | vim.g["test#custom_strategies"] = { 8 | toggleterm = function(cmd) 9 | t.exec(cmd, nil, nil, nil, "float") 10 | end, 11 | toggleterm_close = function(cmd) 12 | local term_id = 0 13 | t.exec(cmd, term_id) 14 | terms.get_or_create_term(term_id):close() 15 | end, 16 | } 17 | end 18 | 19 | return M 20 | -------------------------------------------------------------------------------- /lua/user/vista.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | vim.g["vista#renderer#enable_icon"] = 1 5 | vim.g["vista#renderer#enable_kind"] = 1 6 | vim.g.vista_disable_statusline = 1 7 | vim.g.vista_update_on_text_changed = 1 8 | vim.g.vista_default_executive = "nvim_lsp" -- ctag 9 | vim.g.vista_echo_cursor_strategy = "floating_win" 10 | vim.g.vista_vimwiki_executive = "markdown" 11 | vim.g.vista_executive_for = { 12 | vimwiki = "markdown", 13 | pandoc = "markdown", 14 | markdown = "toc", 15 | typescript = "nvim_lsp", 16 | typescriptreact = "nvim_lsp", 17 | go = "nvim_lsp", 18 | lua = "nvim_lsp", 19 | python = "nvim_lsp", 20 | rust = "nvim_lsp", 21 | } 22 | end 23 | 24 | return M 25 | -------------------------------------------------------------------------------- /lua/user/which.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, wk = pcall(require, "which-key") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | wk.setup(lvim.builtin.which_key.setup) 10 | 11 | local opts = lvim.builtin.which_key.opts 12 | local vopts = lvim.builtin.which_key.vopts 13 | 14 | local mappings = lvim.builtin.which_key.mappings 15 | local vmappings = lvim.builtin.which_key.vmappings 16 | 17 | wk.register(mappings, opts) 18 | wk.register(vmappings, vopts) 19 | end 20 | 21 | return M 22 | -------------------------------------------------------------------------------- /lua/user/winb.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.config = function() 4 | local status_ok, bar = pcall(require, "winbar") 5 | if not status_ok then 6 | return 7 | end 8 | 9 | bar.setup { 10 | enabled = true, 11 | 12 | show_file_path = false, 13 | show_symbols = true, 14 | 15 | colors = { 16 | path = "", -- You can customize colors like #c946fd 17 | file_name = "", 18 | symbols = "", 19 | }, 20 | 21 | icons = { 22 | file_icon_default = "", 23 | seperator = ">", 24 | editor_state = "●", 25 | lock_icon = "", 26 | }, 27 | 28 | exclude_filetype = { 29 | "help", 30 | "startify", 31 | "dashboard", 32 | "lazy", 33 | "neogitstatus", 34 | "NvimTree", 35 | "Trouble", 36 | "alpha", 37 | "lir", 38 | "Outline", 39 | "spectre_panel", 40 | "toggleterm", 41 | "qf", 42 | }, 43 | } 44 | end 45 | 46 | return M 47 | -------------------------------------------------------------------------------- /lua/user/zen.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.hide_diagnostics = function() 4 | vim.diagnostic.hide() 5 | end 6 | 7 | M.show_diagnostics = function() 8 | vim.diagnostic.show() 9 | end 10 | 11 | M.config = function() 12 | local status_ok, zen_mode = pcall(require, "zen-mode") 13 | if not status_ok then 14 | return 15 | end 16 | 17 | zen_mode.setup { 18 | window = { 19 | backdrop = 1, 20 | height = 0.9, -- height of the Zen window 21 | width = 0.6, 22 | options = { 23 | signcolumn = "no", -- disable signcolumn 24 | number = false, -- disable number column 25 | relativenumber = false, -- disable relative numbers 26 | }, 27 | }, 28 | plugins = { 29 | gitsigns = { enabled = false }, -- disables git signs 30 | tmux = { enabled = not lvim.builtin.tmux_lualine }, 31 | twilight = { enabled = true }, 32 | kitty = { 33 | enabled = false, 34 | font = "+2", -- font size increment 35 | }, 36 | }, 37 | on_open = function() 38 | lvim.builtin.cmp.active = false 39 | vim.cmd [[ 40 | set foldlevel=10 41 | lua require("user.zen").hide_diagnostics() 42 | lua require("user.indent_blankline").disable() 43 | ]] 44 | if lvim.builtin.tmux_lualine == false then 45 | require("lualine").hide() 46 | end 47 | end, 48 | on_close = function() 49 | lvim.builtin.cmp.active = true 50 | vim.cmd [[ 51 | set foldlevel=4 52 | set foldmethod=expr 53 | set foldexpr=nvim_treesitter#foldexpr() 54 | lua require("user.zen").show_diagnostics() 55 | lua require("user.indent_blankline").enable() 56 | ]] 57 | if lvim.builtin.tmux_lualine == false then 58 | require("lualine").hide { unhide = true } 59 | end 60 | end, 61 | } 62 | end 63 | 64 | return M 65 | -------------------------------------------------------------------------------- /selene.toml: -------------------------------------------------------------------------------- 1 | std="vim" 2 | 3 | [rules] 4 | global_usage = "allow" 5 | multiple_statements = "allow" 6 | mixed_table = "allow" 7 | -------------------------------------------------------------------------------- /snippets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nvim-snippets", 3 | "author": "abzcoding", 4 | "engines": { 5 | "vscode": "^1.11.0" 6 | }, 7 | "contributes": { 8 | "snippets": [ 9 | { 10 | "language": "lua", 11 | "path": "./lua.json" 12 | }, 13 | { 14 | "language": [ 15 | "typescript", 16 | "typescriptreact" 17 | ], 18 | "path": "./typescript.json" 19 | }, 20 | { 21 | "language": "typescriptreact", 22 | "path": "./react-ts.json" 23 | } 24 | ] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /task_template.ini: -------------------------------------------------------------------------------- 1 | {cmake} 2 | 3 | [project-init] 4 | command=mkdir build && cd build && cmake .. 5 | cwd= 6 | [project-build] 7 | command=cmake --build build 8 | cwd= 9 | errorformat=%. %#--> %f:%l:%c 10 | [project-run] 11 | command=build/$(VIM_PRONAME) 12 | cwd= 13 | output=quickfix 14 | 15 | {cargo} 16 | 17 | [project-init] 18 | command=cargo update 19 | cwd= 20 | [project-build] 21 | command=cargo build 22 | cwd= 23 | [project-run] 24 | command=cargo run 25 | cwd= 26 | output=terminal 27 | -------------------------------------------------------------------------------- /tasks.ini: -------------------------------------------------------------------------------- 1 | # vim: set noet fenc=utf-8 sts=4 sw=4 ts=4 ft=dosini: 2 | 3 | [file-build] 4 | command=echo unsupported filetype $(VIM_FILETYPE) 5 | command:c,cpp/win32=gcc -O2 -Wall -fstrict-aliasing "$(VIM_FILEPATH)" -o "$(VIM_PATHNOEXT)" -lstdc++ -lm -lwinmm -lgdi32 -lws2_32 -msse3 -liphlpapi -ld3d9 -ld3dx9 6 | command:c,cpp/linux=gcc -O2 -Wall -fstrict-aliasing "$(VIM_FILEPATH)" -o "$(VIM_PATHNOEXT)" -lstdc++ -lm -msse3 -ldl -lpthread 7 | command:cpp/macos=g++ -O2 -Wall -fstrict-aliasing "$(VIM_FILEPATH)" -o "$(VIM_PATHNOEXT)" 8 | command:c/macos=gcc -O2 -Wall -fstrict-aliasing "$(VIM_FILEPATH)" -o "$(VIM_PATHNOEXT)" 9 | command:go/win32=go build -o "$(VIM_PATHNOEXT).exe" "$(VIM_FILEPATH)" 10 | command:go/linux=go build -o "$(VIM_PATHNOEXT)" "$(VIM_FILEPATH)" 11 | command:go/macos=go build -o "$(VIM_PATHNOEXT)" "$(VIM_FILEPATH)" 12 | command:make/win32=mingw32-make -f "$(VIM_FILEPATH)" 13 | command:make/linux=make -f "$(VIM_FILEPATH)" 14 | command:make/macos=make -f "$(VIM_FILEPATH)" 15 | command:rust/win32=rustc "$(VIM_FILEPATH)" -o "$(VIM_PATHNOEXT).exe" 16 | command:rust/linux=rustc "$(VIM_FILEPATH)" -o "$(VIM_PATHNOEXT)" 17 | command:rust/macos=rustc "$(VIM_FILEPATH)" -o "$(VIM_PATHNOEXT)" 18 | command:terraform=terraform init && terraform plan 19 | command:zig=zig build 20 | output=quickfix 21 | auto=make 22 | save=2 23 | 24 | [file-run] 25 | command="$(VIM_FILEPATH)" 26 | command:c,cpp="$(VIM_PATHNOEXT)" 27 | command:go="$(VIM_PATHNOEXT)" 28 | command:python=python "$(VIM_FILENAME)" 29 | command:python/linux=python3 "$(VIM_FILENAME)" 30 | command:make=make -f "$(VIM_FILENAME)" run 31 | command:emake=emake -e "$(VIM_FILENAME)" 32 | command:javascript=node "$(VIM_FILENAME)" 33 | command:sh=sh "$(VIM_FILENAME)" 34 | command:lua=lua "$(VIM_FILENAME)" 35 | command:perl=perl "$(VIM_FILENAME)" 36 | command:ruby=ruby "$(VIM_FILENAME)" 37 | command:zsh=zsh "$(VIM_FILENAME)" 38 | command:bash=bash "$(VIM_FILENAME)" 39 | command:fish=fish "$(VIM_FILENAME)" 40 | command:php=php "$(VIM_FILENAME)" 41 | command:erlang=escript "$(VIM_FILENAME)" 42 | command:ps1=powershell -file "$(VIM_FILENAME)" 43 | command:scala=scala "$(VIM_FILENAME)" 44 | command:haskell=ghci "$(VIM_FILENAME)" 45 | command:applescript=osascript "$(VIM_FILENAME)" 46 | command:vim=:source % 47 | command:vb=cscript /nologo "$(VIM_FILENAME)" 48 | command:rust="$(VIM_PATHNOEXT)" 49 | command:bxrc=bochs -q -f "$(VIM_FILENAME)" 50 | command:odin=odin run "$(VIM_FILENAME)" 51 | command:terraform=terraform validate && terraform apply 52 | command:zig=zig run "$(VIM_FILENAME)" 53 | output=quickfix 54 | cwd=$(VIM_FILEDIR) 55 | save=2 56 | 57 | [make] 58 | command=make -f "$(VIM_FILEPATH)" 59 | cwd=$(VIM_FILEDIR) 60 | 61 | [make-run] 62 | command=make -f "$(VIM_FILEPATH)" run 63 | cwd=$(VIM_FILEDIR) 64 | output=terminal 65 | 66 | [make-test] 67 | command=make -f "$(VIM_FILEPATH)" test 68 | cwd=$(VIM_FILEDIR) 69 | output=terminal 70 | 71 | [emake] 72 | command=emake --abs "$(VIM_FILEPATH)" 73 | cwd=$(VIM_FILEDIR) 74 | save=2 75 | 76 | [emake-clean] 77 | command=emake -clean "$(VIM_FILEPATH)" 78 | cwd=$(VIM_FILEDIR) 79 | 80 | [emake-exe] 81 | command=emake -e "$(VIM_FILEPATH)" 82 | cwd=$(VIM_FILEDIR) 83 | output=terminal 84 | 85 | [emake-auto] 86 | command=emake --abs "$(VIM_FILENAME)" 87 | command:make=make -f "$(VIM_FILENAME)" 88 | cwd=$(VIM_FILEDIR) 89 | 90 | [project-build] 91 | command=make 92 | cwd=$(VIM_ROOT) 93 | 94 | [project-run] 95 | command=make run 96 | cwd=$(VIM_ROOT) 97 | output=terminal 98 | 99 | [project-test] 100 | command=make test 101 | cwd=$(VIM_ROOT) 102 | output=terminal 103 | 104 | [cargo-run] 105 | command=cargo run 106 | cwd=$(VIM_ROOT) 107 | output=terminal 108 | 109 | # project-wide search, ask user input keyword 110 | [grep-word] 111 | command=rg -n --no-heading --color never "$(?keyword)" "" -tc -tcpp -tpy -tvim -tgo -tasm -tlua -tjs 112 | cwd= 113 | errorformat=%f:%l:%m 114 | 115 | # project-wide search, search the word under cursor 116 | [grep-cword] 117 | command=rg -n --no-heading --color never "$(VIM_CWORD)" "" -tc -tcpp -tpy -tvim -tgo -tasm -tlua -tjs 118 | cwd= 119 | errorformat=%f:%l:%m 120 | 121 | [vc-2015] 122 | command/win32=d:\dev\vc2015\vcvarsall.cmd cl.exe -nologo -O2 -EHsc "$(VIM_FILEPATH)" 123 | cwd=$(VIM_FILEDIR) 124 | errorformat=%f(%l):%m 125 | 126 | [vc-2017] 127 | command/win32=d:\dev\vc2017\vcvarsall.cmd cl.exe -nologo -O2 /arch:AVX "$(VIM_FILEPATH)" -o "$(VIM_PATHNOEXT).exe" 128 | cwd=$(VIM_FILEDIR) 129 | errorformat=%f(%l):%m 130 | 131 | [git-proxy-on] 132 | command=git config --global http.proxy "socks5://127.0.0.1:1080" && git config --global https.proxy "socks5://127.0.0.1:1080" 133 | 134 | [git-proxy-off] 135 | command=git config --global --unset http.proxy && git config --global --unset https.proxy 136 | -------------------------------------------------------------------------------- /vale_config.ini: -------------------------------------------------------------------------------- 1 | # Vale configuration file. 2 | # 3 | # For more information, see https://errata-ai.gitbook.io/vale/getting-started/configuration. 4 | 5 | StylesPath = /Users/abz/.config/vale 6 | MinAlertLevel = suggestion 7 | 8 | [*.md] 9 | BasedOnStyles = gitlab 10 | 11 | # Ignore SVG markup 12 | TokenIgnores = (\*\*\{\w*\}\*\*) 13 | -------------------------------------------------------------------------------- /vim.toml: -------------------------------------------------------------------------------- 1 | [selene] 2 | base = "lua52" 3 | name = "vim" 4 | 5 | [vim] 6 | any = true 7 | 8 | [lvim] 9 | any = true 10 | 11 | [[describe.args]] 12 | type = "string" 13 | [[describe.args]] 14 | type = "function" 15 | 16 | [[it.args]] 17 | type = "string" 18 | [[it.args]] 19 | type = "function" 20 | 21 | [[before_each.args]] 22 | type = "function" 23 | [[after_each.args]] 24 | type = "function" 25 | 26 | [assert.is_not] 27 | any = true 28 | 29 | [[assert.equals.args]] 30 | type = "any" 31 | [[assert.equals.args]] 32 | type = "any" 33 | [[assert.equals.args]] 34 | type = "any" 35 | required = false 36 | 37 | [[assert.same.args]] 38 | type = "any" 39 | [[assert.same.args]] 40 | type = "any" 41 | 42 | [[assert.truthy.args]] 43 | type = "any" 44 | 45 | [[assert.spy.args]] 46 | type = "any" 47 | 48 | [[assert.stub.args]] 49 | type = "any" 50 | --------------------------------------------------------------------------------