Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b287488a0b |
Generated
+62
-5
@@ -193,6 +193,25 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"herdr": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_3",
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1784213830,
|
||||||
|
"narHash": "sha256-51752gcxLf+W1cFw9u8aCJ+78h8/wQYhsnMX4NkNnYU=",
|
||||||
|
"owner": "ogulcancelik",
|
||||||
|
"repo": "herdr",
|
||||||
|
"rev": "6e4768a7ccb172b96c30eabe745747fbde31f777",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "ogulcancelik",
|
||||||
|
"repo": "herdr",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -371,6 +390,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1779357205,
|
||||||
|
"narHash": "sha256-cCO8aTqss5x9Ky8GWkpY0Hy5fyTZEbtifSUV8QjSzic=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "f83fc3c307e74bc5fd5adb7eb6b8b13ffd2a36e1",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1768323494,
|
"lastModified": 1768323494,
|
||||||
"narHash": "sha256-yBXJLE6WCtrGo7LKiB6NOt6nisBEEkguC/lq/rP3zRQ=",
|
"narHash": "sha256-yBXJLE6WCtrGo7LKiB6NOt6nisBEEkguC/lq/rP3zRQ=",
|
||||||
@@ -386,7 +421,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1749086602,
|
"lastModified": 1749086602,
|
||||||
"narHash": "sha256-DJcgJMekoxVesl9kKjfLPix2Nbr42i7cpEHJiTnBUwU=",
|
"narHash": "sha256-DJcgJMekoxVesl9kKjfLPix2Nbr42i7cpEHJiTnBUwU=",
|
||||||
@@ -402,7 +437,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_6": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1747542820,
|
"lastModified": 1747542820,
|
||||||
"narHash": "sha256-GaOZntlJ6gPPbbkTLjbd8BMWaDYafhuuYRNrxCGnPJw=",
|
"narHash": "sha256-GaOZntlJ6gPPbbkTLjbd8BMWaDYafhuuYRNrxCGnPJw=",
|
||||||
@@ -445,11 +480,12 @@
|
|||||||
"apple-silicon": "apple-silicon",
|
"apple-silicon": "apple-silicon",
|
||||||
"ghostty": "ghostty",
|
"ghostty": "ghostty",
|
||||||
"godig": "godig",
|
"godig": "godig",
|
||||||
|
"herdr": "herdr",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
"nixgl": "nixgl",
|
"nixgl": "nixgl",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"nixpkgs-darwin": "nixpkgs-darwin",
|
"nixpkgs-darwin": "nixpkgs-darwin",
|
||||||
"nixpkgs-electron-32": "nixpkgs-electron-32",
|
"nixpkgs-electron-32": "nixpkgs-electron-32",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
@@ -460,6 +496,27 @@
|
|||||||
"zen-browser": "zen-browser"
|
"zen-browser": "zen-browser"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"herdr",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1783577481,
|
||||||
|
"narHash": "sha256-EWMxOWrJ031f8f/lrcEmhTRs4npw1/5N3Hcjin846c8=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "4cdea398dc491b082dccdce0fad1ed0b75fa3394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"sops-nix": {
|
"sops-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -483,7 +540,7 @@
|
|||||||
"ssh-agent-switcher": {
|
"ssh-agent-switcher": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_5",
|
"flake-utils": "flake-utils_5",
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_5"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1749108251,
|
"lastModified": 1749108251,
|
||||||
@@ -592,7 +649,7 @@
|
|||||||
},
|
},
|
||||||
"walker": {
|
"walker": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_5",
|
"nixpkgs": "nixpkgs_6",
|
||||||
"systems": "systems_6"
|
"systems": "systems_6"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|||||||
@@ -51,6 +51,11 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs-unstable"; # Use same nixpkgs
|
inputs.nixpkgs.follows = "nixpkgs-unstable"; # Use same nixpkgs
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Terminal workspace manager for AI coding agents.
|
||||||
|
herdr = {
|
||||||
|
url = "github:ogulcancelik/herdr";
|
||||||
|
};
|
||||||
|
|
||||||
# Zen browser.
|
# Zen browser.
|
||||||
zen-browser = {
|
zen-browser = {
|
||||||
url = "github:0xc000022070/zen-browser-flake";
|
url = "github:0xc000022070/zen-browser-flake";
|
||||||
@@ -195,6 +200,7 @@
|
|||||||
inherit (config) user;
|
inherit (config) user;
|
||||||
inherit opencode-tunneler;
|
inherit opencode-tunneler;
|
||||||
inherit godig;
|
inherit godig;
|
||||||
|
inherit (inputs) herdr;
|
||||||
};
|
};
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
|||||||
@@ -0,0 +1,177 @@
|
|||||||
|
;---Most generic types---
|
||||||
|
(module) @module
|
||||||
|
|
||||||
|
(identifier) @variable
|
||||||
|
|
||||||
|
(concrete_type) @type
|
||||||
|
|
||||||
|
;---annotations----
|
||||||
|
(annotation_type_def
|
||||||
|
(annotation_pre_colon
|
||||||
|
(identifier) @type))
|
||||||
|
|
||||||
|
(annotation_type_def
|
||||||
|
(annotation_pre_colon
|
||||||
|
(identifier) @function)
|
||||||
|
(function_type))
|
||||||
|
|
||||||
|
;----decleration types----
|
||||||
|
(value_declaration
|
||||||
|
(decl_left
|
||||||
|
(identifier_pattern
|
||||||
|
(identifier) @variable.parameter)))
|
||||||
|
|
||||||
|
;---records----
|
||||||
|
(field_name) @variable.member
|
||||||
|
|
||||||
|
(record_field_pattern
|
||||||
|
(_
|
||||||
|
(identifier) @variable))
|
||||||
|
|
||||||
|
;matches the second identifier and all subsequent ones
|
||||||
|
(field_access_expr
|
||||||
|
(identifier) @variable.member)
|
||||||
|
|
||||||
|
;highlight module members as records instead of free variables
|
||||||
|
; avoids highlighting them as out-of-scope vars
|
||||||
|
(variable_expr
|
||||||
|
(module) (identifier) @variable.member)
|
||||||
|
|
||||||
|
;----comments----
|
||||||
|
(line_comment) @comment @spell
|
||||||
|
|
||||||
|
(doc_comment) @comment.documentation @spell
|
||||||
|
|
||||||
|
;-----Punctuation----
|
||||||
|
[
|
||||||
|
"?"
|
||||||
|
(arrow)
|
||||||
|
(fat_arrow)
|
||||||
|
"|"
|
||||||
|
","
|
||||||
|
":"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
"|"
|
||||||
|
"&"
|
||||||
|
"<-"
|
||||||
|
".."
|
||||||
|
(operator)
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
(wildcard_pattern) @constant.builtin
|
||||||
|
|
||||||
|
[
|
||||||
|
"if"
|
||||||
|
"then"
|
||||||
|
"else"
|
||||||
|
] @keyword.conditional
|
||||||
|
|
||||||
|
[
|
||||||
|
(implements)
|
||||||
|
(when)
|
||||||
|
(is)
|
||||||
|
"as"
|
||||||
|
(to)
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
;----headers-----
|
||||||
|
|
||||||
|
[
|
||||||
|
"app"
|
||||||
|
"expect"
|
||||||
|
"module"
|
||||||
|
"package"
|
||||||
|
"import"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
(import_as)
|
||||||
|
"imports"
|
||||||
|
] @keyword.import
|
||||||
|
|
||||||
|
|
||||||
|
(value_declaration
|
||||||
|
(decl_left
|
||||||
|
(identifier_pattern
|
||||||
|
(identifier) @function))
|
||||||
|
(expr_body
|
||||||
|
(anon_fun_expr)))
|
||||||
|
|
||||||
|
;----tags----
|
||||||
|
(tags_type
|
||||||
|
(tag_type) @constructor)
|
||||||
|
|
||||||
|
[
|
||||||
|
(tag)
|
||||||
|
(opaque_tag)
|
||||||
|
] @constructor
|
||||||
|
|
||||||
|
;-----builtins----
|
||||||
|
(variable_expr
|
||||||
|
(module) @module
|
||||||
|
(identifier) @boolean
|
||||||
|
(#any-of? @boolean "true" "false")
|
||||||
|
(#eq? @module "Bool"))
|
||||||
|
|
||||||
|
"dbg" @keyword.debug
|
||||||
|
|
||||||
|
;----function invocations ----
|
||||||
|
(function_call_pnc_expr
|
||||||
|
caller: (variable_expr
|
||||||
|
(identifier) @function.call))
|
||||||
|
|
||||||
|
(function_call_pnc_expr
|
||||||
|
caller: (field_access_expr
|
||||||
|
(identifier) @function.call .))
|
||||||
|
|
||||||
|
(bin_op_expr
|
||||||
|
(operator
|
||||||
|
"|>") @operator
|
||||||
|
(variable_expr
|
||||||
|
(identifier) @function))
|
||||||
|
|
||||||
|
;----function arguments----
|
||||||
|
(argument_patterns
|
||||||
|
(identifier_pattern
|
||||||
|
(identifier) @variable.parameter))
|
||||||
|
|
||||||
|
(argument_patterns
|
||||||
|
(_
|
||||||
|
(identifier_pattern
|
||||||
|
(identifier) @variable.parameter)))
|
||||||
|
|
||||||
|
(argument_patterns
|
||||||
|
(_
|
||||||
|
(_
|
||||||
|
(identifier_pattern
|
||||||
|
(identifier) @variable.parameter))))
|
||||||
|
|
||||||
|
;-----consts-----
|
||||||
|
[
|
||||||
|
(int)
|
||||||
|
(uint)
|
||||||
|
(iint)
|
||||||
|
(xint)
|
||||||
|
(natural)
|
||||||
|
] @number
|
||||||
|
|
||||||
|
[
|
||||||
|
(decimal)
|
||||||
|
(float)
|
||||||
|
] @number.float
|
||||||
|
|
||||||
|
(string) @string
|
||||||
|
(multiline_string) @string
|
||||||
|
|
||||||
|
(char) @character
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
; (value_declaration(expr_body(anon_fun_expr)))@indent.ignore
|
||||||
|
[
|
||||||
|
(when_is_expr)
|
||||||
|
(when_is_branch)
|
||||||
|
(record_expr)
|
||||||
|
(anon_fun_expr)
|
||||||
|
(list_expr)
|
||||||
|
(parenthesized_expr)
|
||||||
|
(function_call_pnc_expr)
|
||||||
|
(tuple_expr)
|
||||||
|
(backpassing_expr)
|
||||||
|
(imports)
|
||||||
|
(exposes)
|
||||||
|
(exposes_list)
|
||||||
|
(exposing)
|
||||||
|
;;patterns
|
||||||
|
(record_pattern)
|
||||||
|
(tuple_pattern)
|
||||||
|
(list_pattern)
|
||||||
|
|
||||||
|
;;ability stuff
|
||||||
|
(ability_implementation)
|
||||||
|
(opaque_type_def)
|
||||||
|
;;types
|
||||||
|
(record_type)
|
||||||
|
(tags_type)
|
||||||
|
(record_expr)
|
||||||
|
(implements_implementation)
|
||||||
|
"{"
|
||||||
|
"("
|
||||||
|
"["
|
||||||
|
]
|
||||||
|
@indent.begin
|
||||||
|
|
||||||
|
; ((record_type)
|
||||||
|
; @indent.align
|
||||||
|
; (#set! indent.open_delimiter "{")
|
||||||
|
; (#set! indent.close_delimiter "}"))
|
||||||
|
; ((record_expr)
|
||||||
|
; @indent.align
|
||||||
|
; (#set! indent.open_delimiter "{")
|
||||||
|
; (#set! indent.close_delimiter "}"))
|
||||||
|
; ((tags_type) @indent.align
|
||||||
|
; (#set! indent.open_delimiter "[")
|
||||||
|
; (#set! indent.close_delimiter "]"))
|
||||||
|
; ((implements_implementation) @indent.align
|
||||||
|
; (#set! indent.open_delimiter "[")
|
||||||
|
; (#set! indent.close_delimiter "]"))
|
||||||
|
|
||||||
|
|
||||||
|
(expr_body)@indent.begin
|
||||||
|
|
||||||
|
(ERROR "=")@indent.begin
|
||||||
|
(then )@indent.begin
|
||||||
|
(else)@indent.begin
|
||||||
|
[
|
||||||
|
; result:(_)
|
||||||
|
"]"
|
||||||
|
"}"
|
||||||
|
")"
|
||||||
|
]@indent.branch
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
;injection from function calls
|
||||||
|
(function_call_pnc_expr
|
||||||
|
(variable_expr (identifier) @injection.language)
|
||||||
|
(const [(multiline_string) (string)] @injection.content)
|
||||||
|
(#any-eq? @injection.language
|
||||||
|
"json"
|
||||||
|
"toml"
|
||||||
|
"yaml"
|
||||||
|
"xml"
|
||||||
|
"sql"
|
||||||
|
"lua"
|
||||||
|
"js"
|
||||||
|
"html"
|
||||||
|
"css"
|
||||||
|
"http"
|
||||||
|
"jq"
|
||||||
|
"latex"
|
||||||
|
"md"
|
||||||
|
"nix"
|
||||||
|
"regex"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
;injection from piping function calls
|
||||||
|
(bin_op_expr
|
||||||
|
part: (const
|
||||||
|
[(multiline_string) (string)] @injection.content
|
||||||
|
)
|
||||||
|
part: (operator)
|
||||||
|
part: (variable_expr
|
||||||
|
(identifier) @injection.language
|
||||||
|
)
|
||||||
|
(#any-eq? @injection.language
|
||||||
|
"json"
|
||||||
|
"toml"
|
||||||
|
"yaml"
|
||||||
|
"xml"
|
||||||
|
"sql"
|
||||||
|
"lua"
|
||||||
|
"js"
|
||||||
|
"html"
|
||||||
|
"css"
|
||||||
|
"http"
|
||||||
|
"jq"
|
||||||
|
"latex"
|
||||||
|
"md"
|
||||||
|
"nix"
|
||||||
|
"regex"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
[
|
||||||
|
(line_comment)
|
||||||
|
(doc_comment)
|
||||||
|
] @injection.content
|
||||||
|
(#set! injection.language "comment")
|
||||||
|
)
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
(expr_body) @local.scope
|
||||||
|
|
||||||
|
(argument_patterns
|
||||||
|
(identifier_pattern
|
||||||
|
(identifier) @local.definition))
|
||||||
|
|
||||||
|
; (argument_patterns(long_identifier)@local.definition)
|
||||||
|
(exposes_list
|
||||||
|
(identifier) @local.reference)
|
||||||
|
|
||||||
|
(import_expr(as)(module)@local.definition)
|
||||||
|
|
||||||
|
(opaque_type_def
|
||||||
|
(apply_type
|
||||||
|
(concrete_type) @local.definition.type))
|
||||||
|
|
||||||
|
(alias_type_def
|
||||||
|
(apply_type
|
||||||
|
(concrete_type) @local.definition.type))
|
||||||
|
|
||||||
|
(value_declaration
|
||||||
|
(decl_left
|
||||||
|
(identifier_pattern
|
||||||
|
(identifier) @local.definition.function))
|
||||||
|
(expr_body
|
||||||
|
(anon_fun_expr)))
|
||||||
|
|
||||||
|
(value_declaration
|
||||||
|
(decl_left
|
||||||
|
(identifier_pattern
|
||||||
|
(identifier) @local.definition.var)))
|
||||||
|
|
||||||
|
(identifier_pattern
|
||||||
|
(identifier) @local.definition)
|
||||||
|
|
||||||
|
(when_is_branch pattern: (_ (identifier_pattern (identifier) @local.definition)))
|
||||||
|
(spread_pattern (identifier) @local.definition)
|
||||||
|
|
||||||
|
(identifier) @local.reference
|
||||||
|
|
||||||
|
(tag_expr
|
||||||
|
(tag)) @local.reference
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
(anon_fun_expr
|
||||||
|
(expr_body) @function.inner
|
||||||
|
) @function.outer
|
||||||
|
|
||||||
|
(argument_patterns
|
||||||
|
((_) @parameter.inner . ","? @parameter.outer) @parameter.outer
|
||||||
|
)
|
||||||
|
|
||||||
|
(function_type
|
||||||
|
((_) @parameter.inner . ","? @parameter.outer) @parameter.outer(#not-eq? @parameter.inner "->")
|
||||||
|
)
|
||||||
|
|
||||||
|
(function_pnc_expr
|
||||||
|
.
|
||||||
|
(_)
|
||||||
|
(parenthesized_expr (expr_body) @parameter.inner) @parameter.outer
|
||||||
|
)
|
||||||
|
|
||||||
|
(function_pnc_expr
|
||||||
|
.
|
||||||
|
(_) ((_) @parameter.inner) @parameter.outer
|
||||||
|
)
|
||||||
|
|
||||||
|
[
|
||||||
|
(annotation_type_def ) @class.inner
|
||||||
|
(alias_type_def ) @class.inner
|
||||||
|
(opaque_type_def ) @class.inner
|
||||||
|
] @class.outer
|
||||||
|
|
||||||
|
(apply_type_arg) @parameter.inner
|
||||||
|
|
||||||
|
(line_comment) @comment.outer
|
||||||
|
(doc_comment) @comment.outer
|
||||||
@@ -1,9 +1,30 @@
|
|||||||
vim.g.mapleader = ' '
|
|
||||||
vim.g.maplocalleader = ' '
|
|
||||||
|
|
||||||
require('settings')
|
require('settings')
|
||||||
|
require('nv-globals')
|
||||||
require('plugins')
|
require('plugins')
|
||||||
require('colorscheme')
|
require('colorscheme')
|
||||||
require('completion')
|
require('settings')
|
||||||
|
|
||||||
|
-- Must go after plugins.
|
||||||
|
require("oil").setup()
|
||||||
|
|
||||||
|
-- LSP
|
||||||
require('lsp')
|
require('lsp')
|
||||||
|
require('lsp.typescript-ls')
|
||||||
|
require('lsp.python-ls')
|
||||||
|
require('lsp.lua-ls')
|
||||||
|
require('lsp.go-ls')
|
||||||
|
require('lsp.zls-ls')
|
||||||
|
require('lsp.clang-ls')
|
||||||
|
require('lsp.rust-analyzer')
|
||||||
|
|
||||||
|
-- Completion
|
||||||
|
require('completion')
|
||||||
|
|
||||||
|
require('nv-prettier')
|
||||||
|
|
||||||
|
require('nv-telescope')
|
||||||
|
|
||||||
|
-- require('langs.roc')
|
||||||
|
|
||||||
|
-- Set up keymaps after everything is configured.
|
||||||
require('keymappings')
|
require('keymappings')
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"auto-pairs": { "branch": "master", "commit": "39f06b873a8449af8ff6a3eee716d3da14d63a76" },
|
|
||||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
|
||||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
|
||||||
"cmp-snippy": { "branch": "master", "commit": "6e39210aa3a74e2bf6462f492eaf0d436cd2b7d3" },
|
|
||||||
"conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" },
|
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "070a5d7b985546cc57e1fc61e5bc507fecac6045" },
|
|
||||||
"grug-far.nvim": { "branch": "main", "commit": "11595bf747edc270bce2069d1020502ad4ae56cf" },
|
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "f1e186e44d3b7f9ae918008e2c28ce37c6023d2d" },
|
|
||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
|
||||||
"lightline.vim": { "branch": "master", "commit": "d042c506cb2e7a59112a72447e0b5fe8739d9d1d" },
|
|
||||||
"nvim-cmp": { "branch": "main", "commit": "2ffe79f1f021def8dd1fcd81deb16f1bb0d989f3" },
|
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "046b1a797af1effe8e0474b9af9657a3761ec58a" },
|
|
||||||
"nvim-snippy": { "branch": "master", "commit": "1f5a5c82cb4902522806a58cf25479f6f8fe16ac" },
|
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "58447c1fca354bbf184425e4a8d01deecbd6f3c4" },
|
|
||||||
"oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" },
|
|
||||||
"palenight.vim": { "branch": "master", "commit": "9e9b102c54b830b72f51917b6b86c3b3b02dcea2" },
|
|
||||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
|
||||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
|
||||||
"telescope.nvim": { "branch": "master", "commit": "84b9ba066d1860f7a586ce9cd732fd6c4f77d1d9" },
|
|
||||||
"transparent.nvim": { "branch": "main", "commit": "a4145c52f5421f1626a4d7dc0f41e785c4439944" },
|
|
||||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
|
||||||
"vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" },
|
|
||||||
"vim-gitbranch": { "branch": "master", "commit": "1a8ba866f3eaf0194783b9f8573339d6ede8f1ed" },
|
|
||||||
"vim-go": { "branch": "master", "commit": "47694979496d4bf2e90ce75d95f1dec3f41cbefb" },
|
|
||||||
"vim-polyglot": { "branch": "master", "commit": "f061eddb7cdcc614c8406847b2bfb53099832a4e" },
|
|
||||||
"vim-rooter": { "branch": "master", "commit": "51402fb77c4d6ae94994e37dc7ca13bec8f4afcc" },
|
|
||||||
"vim-smoothie": { "branch": "master", "commit": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e" },
|
|
||||||
"vim-styled-components": { "branch": "main", "commit": "75e178916fc3e61385350933a23055927f5f60b7" },
|
|
||||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
|
||||||
"vim_current_word": { "branch": "master", "commit": "967c73804e38e5b2ceaa536328a4f76f1157a482" },
|
|
||||||
"zig.vim": { "branch": "master", "commit": "4842ab8cb1b000a9acb0a06170d404d12a154918" }
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
vim.opt.background = 'dark'
|
vim.api.nvim_set_option('background', 'dark')
|
||||||
vim.opt.termguicolors = true
|
vim.api.nvim_set_option('termguicolors', true)
|
||||||
|
|
||||||
-- colorscheme
|
-- colorscheme
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
local cmp = require('cmp')
|
vim.o.completeopt = "menuone,noselect"
|
||||||
local snippy = require('snippy')
|
-- Avoid having a "Pattern not found" message
|
||||||
|
vim.cmd("set shortmess+=c")
|
||||||
|
|
||||||
vim.opt.completeopt = { 'menuone', 'noselect' }
|
local cmp = require'cmp'
|
||||||
vim.opt.shortmess:append('c')
|
local snippy = require('snippy')
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
window = {
|
window = {
|
||||||
@@ -22,11 +23,11 @@ cmp.setup({
|
|||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'path' },
|
{ name = 'async_path' },
|
||||||
{ name = 'snippy' },
|
{ name = 'snippy' },
|
||||||
}, {
|
}, {
|
||||||
{ name = 'buffer' },
|
{ name = 'buffer' },
|
||||||
}),
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
snippy.setup({
|
snippy.setup({
|
||||||
@@ -37,3 +38,81 @@ snippy.setup({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
require('lspsaga').setup({})
|
||||||
|
|
||||||
|
-- require'compe'.setup {
|
||||||
|
-- enabled = true;
|
||||||
|
-- autocomplete = true;
|
||||||
|
-- debug = false;
|
||||||
|
-- min_length = 1;
|
||||||
|
-- preselect = 'always';
|
||||||
|
-- throttle_time = 80;
|
||||||
|
-- source_timeout = 200;
|
||||||
|
-- incomplete_delay = 400;
|
||||||
|
-- max_abbr_width = 100;
|
||||||
|
-- max_kind_width = 100;
|
||||||
|
-- max_menu_width = 100;
|
||||||
|
-- documentation = true;
|
||||||
|
|
||||||
|
-- source = {
|
||||||
|
-- path = true;
|
||||||
|
-- buffer = false;
|
||||||
|
-- calc = false;
|
||||||
|
-- vsnip = false; -- Could be used if I want to start using snippets.
|
||||||
|
-- nvim_lsp = true;
|
||||||
|
-- nvim_lua = true;
|
||||||
|
-- tags = true;
|
||||||
|
-- snippets_nvim = true;
|
||||||
|
-- treesitter = true;
|
||||||
|
-- };
|
||||||
|
-- }
|
||||||
|
|
||||||
|
-- vim.cmd([[
|
||||||
|
-- autocmd FileType ocaml call compe#setup({
|
||||||
|
-- \ 'preselect': 'disable'
|
||||||
|
-- \ }, 0)
|
||||||
|
-- ]])
|
||||||
|
|
||||||
|
-- local t = function(str)
|
||||||
|
-- return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- _G.comp_jump_if_avail = function()
|
||||||
|
-- if vim.fn.pumvisible() == 1 then
|
||||||
|
-- return t "<C-n>"
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
-- _G.comp_jump_prev_if_avail = function()
|
||||||
|
-- if vim.fn.pumvisible() == 1 then
|
||||||
|
-- return t "<C-p>"
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
-- _G.tab_complete = function()
|
||||||
|
-- if vim.fn.pumvisible() == 1 then
|
||||||
|
-- return vim.fn['compe#confirm']('')
|
||||||
|
-- else
|
||||||
|
-- return t "<Tab>"
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
-- _G.enter_complete = function()
|
||||||
|
-- if vim.bo.filetype == "ocaml" then
|
||||||
|
-- return t "<CR>"
|
||||||
|
-- elseif vim.fn.pumvisible() == 1 then
|
||||||
|
-- return vim.fn['compe#confirm']('')
|
||||||
|
-- else
|
||||||
|
-- return t "<CR>"
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- vim.api.nvim_set_keymap("i", "<C-n>", "v:lua.comp_jump_if_avail()", {expr = true})
|
||||||
|
-- vim.api.nvim_set_keymap("s", "<C-n>", "v:lua.comp_jump_if_avail()", {expr = true})
|
||||||
|
-- vim.api.nvim_set_keymap("i", "<C-e>", "v:lua.comp_jump_prev_if_avail()", {expr = true})
|
||||||
|
-- vim.api.nvim_set_keymap("s", "<C-e>", "v:lua.comp_jump_prev_if_avail()", {expr = true})
|
||||||
|
-- -- The next 4 funtcions don't work if compe doesn't automatically select the first option.
|
||||||
|
-- -- meaning the preselect option has to be set to alwasy.
|
||||||
|
-- vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||||
|
-- vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||||
|
-- vim.api.nvim_set_keymap("i", "<CR>", "v:lua.enter_complete()", {expr = true})
|
||||||
|
-- vim.api.nvim_set_keymap("s", "<CR>", "v:lua.enter_complete()", {expr = true})
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +1,97 @@
|
|||||||
local map = vim.keymap.set
|
local lsp = vim.lsp
|
||||||
|
local handlers = lsp.handlers
|
||||||
|
-- local saga = require('lspsaga')
|
||||||
|
-- saga.init_lsp_saga()
|
||||||
|
|
||||||
map('n', '<Space>', '<Nop>', { silent = true })
|
-- Space as leader.
|
||||||
map('i', ',m', '<Esc>', { silent = true })
|
vim.api.nvim_set_keymap('n', '<Space>', '<NOP>', {noremap = true, silent = true})
|
||||||
|
vim.g.mapleader = ' '
|
||||||
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
for _, mode in ipairs({ 'n', 'i', 'v', 's', 'x', 'c', 'o', 't' }) do
|
-- Exit insert mode with ,h.
|
||||||
map(mode, '<C-g>', '<Esc>', { silent = true })
|
vim.api.nvim_set_keymap('i', ',m', '<ESC>', {noremap = true, silent = true})
|
||||||
end
|
|
||||||
map('i', '<C-l>', '<Right>', { silent = true })
|
|
||||||
|
|
||||||
for _, direction in ipairs({ 'h', 'j', 'k', 'l' }) do
|
-- Remap for colemak-dhm.
|
||||||
map('n', '<leader>w' .. direction, '<C-w>' .. direction, { desc = 'Move to window ' .. direction })
|
-- Left.
|
||||||
end
|
-- vim.api.nvim_set_keymap('', 'm', 'h', {noremap = true, silent = true})
|
||||||
map('n', '<leader>fw', '<cmd>write<cr>', { desc = 'Write file' })
|
-- vim.api.nvim_set_keymap('', 'h', 'm', {noremap = true, silent = true})
|
||||||
map('n', '<leader><leader>', '<C-^>', { desc = 'Alternate buffer' })
|
-- Down.
|
||||||
|
-- vim.api.nvim_set_keymap('', 'j', 'n', {noremap = true, silent = true})
|
||||||
|
-- vim.api.nvim_set_keymap('', 'n', 'j', {noremap = true, silent = true})
|
||||||
|
-- Up.
|
||||||
|
-- vim.api.nvim_set_keymap('', 'k', 'e', {noremap = true, silent = true})
|
||||||
|
-- vim.api.nvim_set_keymap('', 'e', 'k', {noremap = true, silent = true})
|
||||||
|
-- Right.
|
||||||
|
-- vim.api.nvim_set_keymap('', 'l', 'i', {noremap = true, silent = true})
|
||||||
|
-- vim.api.nvim_set_keymap('', 'i', 'l', {noremap = true, silent = true})
|
||||||
|
|
||||||
map('n', '<leader>ff', '<cmd>Telescope find_files<cr>', { desc = 'Find files' })
|
-- C-g as ESC
|
||||||
map('n', '<leader>fb', '<cmd>Oil .<cr>', { desc = 'Browse current directory' })
|
vim.api.nvim_set_keymap('n', '<C-g>', '<ESC>', {silent = true})
|
||||||
map('n', '<leader>fc', '<cmd>Oil<cr>', { desc = 'Browse file directory' })
|
vim.api.nvim_set_keymap('i', '<C-g>', '<ESC>', {silent = true})
|
||||||
map('n', '<leader>fo', '<cmd>Oil<cr>', { desc = 'Open file directory' })
|
vim.api.nvim_set_keymap('v', '<C-g>', '<ESC>', {silent = true})
|
||||||
map('n', '<leader>ps', '<cmd>Telescope live_grep<cr>', { desc = 'Search text' })
|
vim.api.nvim_set_keymap('s', '<C-g>', '<ESC>', {silent = true})
|
||||||
map('n', '<leader>bs', '<cmd>Telescope buffers<cr>', { desc = 'Search buffers' })
|
vim.api.nvim_set_keymap('x', '<C-g>', '<ESC>', {silent = true})
|
||||||
map('n', '<leader>sr', '<cmd>GrugFar<cr>', { desc = 'Search and replace' })
|
vim.api.nvim_set_keymap('c', '<C-g>', '<ESC>', {silent = true})
|
||||||
map('n', '<leader>rsr', '<cmd>GrugFarWithin<cr>', { desc = 'Open range replacement' })
|
vim.api.nvim_set_keymap('o', '<C-g>', '<ESC>', {silent = true})
|
||||||
|
vim.api.nvim_set_keymap('l', '<C-g>', '<ESC>', {silent = true})
|
||||||
|
vim.api.nvim_set_keymap('t', '<C-g>', '<ESC>', {silent = true})
|
||||||
|
|
||||||
map({ 'n', 'x' }, '<leader>ca', vim.lsp.buf.code_action, { desc = 'Code action' })
|
-- Move right when in insert mode.
|
||||||
map('n', '<leader>lgd', vim.lsp.buf.definition, { desc = 'Go to definition' })
|
vim.api.nvim_set_keymap("i", '<C-l>', '<Right>', {noremap = true, silent = true})
|
||||||
map('n', '<leader>lgD', vim.lsp.buf.declaration, { desc = 'Go to declaration' })
|
|
||||||
map('n', '<leader>lgr', vim.lsp.buf.references, { desc = 'Find references' })
|
|
||||||
map('n', '<leader>lgi', vim.lsp.buf.implementation, { desc = 'Go to implementation' })
|
|
||||||
map('n', '<leader>lr', vim.lsp.buf.rename, { desc = 'Rename symbol' })
|
|
||||||
map('n', '<leader>lf', function()
|
|
||||||
require('conform').format({ async = true, lsp_format = 'fallback' })
|
|
||||||
end, { desc = 'Format buffer' })
|
|
||||||
map('x', '<leader>lrf', vim.lsp.buf.format, { desc = 'Format selection' })
|
|
||||||
map('n', 'K', function()
|
|
||||||
vim.lsp.buf.hover({ border = 'rounded', max_width = 80 })
|
|
||||||
end, { desc = 'Hover documentation' })
|
|
||||||
|
|
||||||
map('n', '<leader>lld', function()
|
-- Leader window movement.
|
||||||
vim.diagnostic.open_float({ scope = 'line', border = 'rounded' })
|
vim.api.nvim_set_keymap("n", '<Leader>wh', '<C-w>h', {noremap = true, silent = true})
|
||||||
end, { desc = 'Line diagnostics' })
|
vim.api.nvim_set_keymap("n", '<Leader>wj', '<C-w>j', {noremap = true, silent = true})
|
||||||
map('n', '<leader>lwd', '<cmd>Trouble diagnostics toggle<cr>', { desc = 'Workspace diagnostics' })
|
vim.api.nvim_set_keymap("n", '<Leader>wk', '<C-w>k', {noremap = true, silent = true})
|
||||||
map('n', '<leader>ldd', '<cmd>Trouble diagnostics toggle filter.buf=0<cr>', { desc = 'Buffer diagnostics' })
|
vim.api.nvim_set_keymap("n", '<Leader>wl', '<C-w>l', {noremap = true, silent = true})
|
||||||
|
|
||||||
|
-- Quick save.
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>fw', ':w<CR>', {silent = true})
|
||||||
|
|
||||||
|
-- Toggle between buffers.
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader><Leader>', '<C-^>', {noremap = true, silent = true})
|
||||||
|
|
||||||
|
-- Find files inside the current folder.
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>ff', '<cmd>Telescope find_files<cr>',{})
|
||||||
|
-- Find files and folders allowing creation.
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>fb', '<cmd>Telescope file_browser<cr>', {noremap = true})
|
||||||
|
-- File brosers starting at the cwd.
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>fc', '<cmd>Telescope file_browser path=%:p:h<cr>', {noremap = true})
|
||||||
|
-- File browser that allows edits in-buffer.
|
||||||
|
vim.keymap.set("n", "<Leader>fo", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||||
|
-- Do a grep search in the current folder.
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>ps', ':Rg<cr>',{})
|
||||||
|
-- Search among the currently open buffers.
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>bs', '<cmd>Telescope buffers<cr>',{})
|
||||||
|
-- Code actions.
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>ca', "<Cmd>lua vim.lsp.buf.code_action()<CR>",{silent = true, noremap = true})
|
||||||
|
vim.api.nvim_set_keymap('x', '<Leader>ca', "<Cmd>lua vim.lsp.buf.range_code_action()<CR>",{silent = true, noremap = true})
|
||||||
|
-- Search and replace.
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>sr', ':GrugFar<cr>', {noremap = true, silent = true})
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>rsr', ':GrugFarWithin<cr>', {noremap = true, silent = true})
|
||||||
|
|
||||||
|
|
||||||
|
-- Hover doc popup
|
||||||
|
local pop_opts = { border = "rounded", max_width = 80 }
|
||||||
|
handlers["textDocument/hover"] = lsp.with(handlers.hover, pop_opts)
|
||||||
|
handlers["textDocument/signatureHelp"] = lsp.with(handlers.signature_help, pop_opts)
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>lgd', '<cmd>lua vim.lsp.buf.definition()<CR>', {noremap = true, silent = true})
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>lgD', '<cmd>lua vim.lsp.buf.declaration()<CR>', {noremap = true, silent = true})
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>lgr', '<cmd>lua vim.lsp.buf.references()<CR>', {noremap = true, silent = true})
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>lgi', '<cmd>lua vim.lsp.buf.implementation()<CR>', {noremap = true, silent = true})
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>lf', '<cmd>lua require("conform").format({ async = true, lsp_fallback = true })<CR>', {noremap = true, silent = true})
|
||||||
|
vim.keymap.set('v', '<Leader>lrf', vim.lsp.buf.format)
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>lr', '<cmd>Lspsaga rename<CR>', {silent = true})
|
||||||
|
vim.api.nvim_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', {noremap = true, silent = true})
|
||||||
|
|
||||||
|
------ Trouble
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>lld", '<cmd>lua vim.diagnostic.open_float({scope="line"})<CR>',
|
||||||
|
{silent = true, noremap = true}
|
||||||
|
) -- Mnemonic "lsp line diagnostics"
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>lwd", "<cmd>Trouble workspace_diagnostics<cr>",
|
||||||
|
{silent = true, noremap = true}
|
||||||
|
) -- Mnemonic "lsp workspace diagnostics"
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>ldd", "<cmd>Trouble document_diagnostics<cr>",
|
||||||
|
{silent = true, noremap = true}
|
||||||
|
) -- Mnemonic "lsp document diagnostics"
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
-- make .roc files have the correct filetype
|
||||||
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||||
|
pattern = { "*.roc" },
|
||||||
|
command = "set filetype=roc",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- add roc tree-sitter
|
||||||
|
local parsers = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
|
|
||||||
|
parsers.roc = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/faldor20/tree-sitter-roc",
|
||||||
|
files = { "src/parser.c", "src/scanner.c" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||||
|
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||||
|
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||||
|
-- Instead of true it can also be a list of languages
|
||||||
|
-- additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
require'lspconfig'.arduino_language_server.setup {
|
||||||
|
cmd = {
|
||||||
|
"arduino-language-server",
|
||||||
|
"-cli-config", "/Users/aym/Library/Arduino15/arduino-cli.yaml",
|
||||||
|
"-fqbn", "adafruit:nrf52:feather52841",
|
||||||
|
"-cli", "arduino-cli",
|
||||||
|
"-clangd", "clangd"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
vim.lsp.enable('clangd')
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
local elixir_ls_binary = "/Users/" .. USER .. "/.config/nvim/lang-srvrs/elixir-ls/language_server.sh"
|
||||||
|
|
||||||
|
require'lspconfig'.elixirls.setup{
|
||||||
|
cmd = { elixir_ls_binary };
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.api.nvim_command('autocmd BufWritePost *.ex :lua vim.lsp.buf.formatting()')
|
||||||
|
vim.api.nvim_command('autocmd BufWritePost *.exs :lua vim.lsp.buf.formatting()')
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
require("flutter-tools").setup{
|
||||||
|
} -- use defaults
|
||||||
|
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
-- local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
--vim.lsp.config('gopls', {
|
||||||
|
-- on_attach = function(client, bufnr)
|
||||||
|
-- require "lsp_signature".on_attach({
|
||||||
|
-- bind = true,
|
||||||
|
-- -- floating_window = true,
|
||||||
|
-- --hint_enable = true,
|
||||||
|
-- fix_pos = true,
|
||||||
|
-- use_lspsaga = true,
|
||||||
|
-- handler_opts = {
|
||||||
|
-- border = "rounded" -- double, single, shadow, none
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
|
-- cmd = {"gopls", "serve"},
|
||||||
|
-- settings = {
|
||||||
|
-- autostart = true,
|
||||||
|
-- gopls = {
|
||||||
|
-- analyses = {
|
||||||
|
-- unusedparams = true,
|
||||||
|
-- },
|
||||||
|
-- staticcheck = true,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- autostart = true,
|
||||||
|
-- root_dir = require('lspconfig').util.root_pattern(".git","go.mod"),
|
||||||
|
-- init_options = {usePlaceholders = false, completeUnimported = true},
|
||||||
|
-- -- capabilities = capabilities,
|
||||||
|
-- single_file_support = true;
|
||||||
|
--})
|
||||||
|
vim.lsp.enable('gopls')
|
||||||
|
|
||||||
|
|
||||||
|
------ Configre vim-go
|
||||||
|
-- Disable autocomplete since we already have it with native lsp.
|
||||||
|
vim.g.go_code_completion_enabled = 0
|
||||||
|
-- Disable gopls for the same reasons as above.
|
||||||
|
vim.g.go_gopls_enabled = 0
|
||||||
|
|
||||||
|
-- Simplify code when formatting.
|
||||||
|
vim.g.go_fmt_command = 'gofmt'
|
||||||
|
vim.g.go_fmt_options = {
|
||||||
|
gofmt = '-s',
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.g.go_imports_mode = 'goimports'
|
||||||
|
|
||||||
|
-- Could confilg with lsp saga, should experiment.
|
||||||
|
vim.g.go_doc_keywordprg_enabled = 0
|
||||||
|
|
||||||
|
-- Use my own universal mappings for lsp.
|
||||||
|
vim.g.go_def_mapping_enabled = 0
|
||||||
|
|
||||||
|
-- Use globally installed binaries first. (gopls) installed through brew.
|
||||||
|
vim.g.go_search_bin_path_first = 0
|
||||||
|
|
||||||
|
-- When auto-creating a template file, use the package rather than a file.
|
||||||
|
vim.g.go_template_use_pkg = 1
|
||||||
|
|
||||||
|
-- Configure folding.
|
||||||
|
-- vim.cmd("autocmd FileType go setlocal foldmethod=syntax")
|
||||||
|
-- vim.g.go_fmt_experimental = 1
|
||||||
|
|
||||||
|
-- Use a ruler for go files.
|
||||||
|
vim.cmd("autocmd FileType go setlocal colorcolumn=80")
|
||||||
|
-- Automatically add comment symbol on next line and wrap it.
|
||||||
|
vim.cmd("autocmd FileType go setlocal fo+=c fo+=r")
|
||||||
|
|
||||||
|
-- Highlights.
|
||||||
|
vim.g.go_highlight_operators = 1
|
||||||
|
vim.g.go_highlight_types = 1
|
||||||
|
vim.g.go_highlight_extra_types = 1
|
||||||
|
vim.g.go_highlight_functions = 1
|
||||||
|
vim.g.go_highlight_function_calls = 1
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
|
|
||||||
for _, server in ipairs({ 'ts_ls', 'basedpyright', 'gopls', 'zls', 'clangd', 'rust_analyzer' }) do
|
|
||||||
vim.lsp.config(server, { capabilities = capabilities })
|
|
||||||
vim.lsp.enable(server)
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.lsp.config('lua_ls', {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_init = function(client)
|
|
||||||
local workspace = client.workspace_folders and client.workspace_folders[1]
|
|
||||||
if workspace and (vim.uv.fs_stat(workspace.name .. '/.luarc.json')
|
|
||||||
or vim.uv.fs_stat(workspace.name .. '/.luarc.jsonc')) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua or {}, {
|
|
||||||
runtime = { version = 'LuaJIT' },
|
|
||||||
workspace = { checkThirdParty = false, library = { vim.env.VIMRUNTIME } },
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
settings = { Lua = {} },
|
|
||||||
})
|
|
||||||
vim.lsp.enable('lua_ls')
|
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
vim.lsp.config('lua_ls', {
|
||||||
|
on_init = function(client)
|
||||||
|
if client.workspace_folders then
|
||||||
|
local path = client.workspace_folders[1].name
|
||||||
|
if vim.uv.fs_stat(path..'/.luarc.json') or vim.uv.fs_stat(path..'/.luarc.jsonc') then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
||||||
|
runtime = {
|
||||||
|
-- Tell the language server which version of Lua you're using
|
||||||
|
-- (most likely LuaJIT in the case of Neovim)
|
||||||
|
version = 'LuaJIT'
|
||||||
|
},
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = {
|
||||||
|
vim.env.VIMRUNTIME
|
||||||
|
-- Depending on the usage, you might want to add additional paths here.
|
||||||
|
-- "${3rd}/luv/library"
|
||||||
|
-- "${3rd}/busted/library",
|
||||||
|
}
|
||||||
|
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
|
||||||
|
-- library = vim.api.nvim_get_runtime_file("", true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
Lua = {}
|
||||||
|
},
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
vim.lsp.enable('lua_ls')
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
require'lspconfig'.ocamllsp.setup{}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
-- require'lspconfig'.pyright.setup{}
|
||||||
|
|
||||||
|
vim.lsp.enable('basedpyright')
|
||||||
|
|
||||||
|
-- Autoformat on save.
|
||||||
|
-- vim.cmd("autocmd BufWritePre *.py execute ':Black'")
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
require'lspconfig'.roc_ls.setup{
|
||||||
|
offset_encoding = "utf-8",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Should get rid of this once semantic highlighting gets better!
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||||
|
callback = function(ev)
|
||||||
|
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||||
|
client.server_capabilities.semanticTokensProvider = nil
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
vim.lsp.enable('rust_analyzer')
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
local lspconfig = require "lspconfig"
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
|
||||||
|
lspconfig.millet.setup{
|
||||||
|
cmd = { "millet-ls" },
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
vim.lsp.config('ts_ls', {
|
||||||
|
filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" },
|
||||||
|
root_dir = require('lspconfig/util').root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")
|
||||||
|
})
|
||||||
|
vim.lsp.enable('ts_ls')
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
vim.lsp.enable('zls')
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
DATA_PATH = vim.fn.stdpath('data')
|
||||||
|
CACHE_PATH = vim.fn.stdpath('cache')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
vim.g["prettier#autoformat"] = 1
|
||||||
|
vim.g["prettier#autoformat_require_pragma"] = 0
|
||||||
|
vim.g["prettier#exec_cmd_async"] = 1
|
||||||
|
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
require('telescope').setup({
|
-- This is your opts table
|
||||||
|
require("telescope").setup {
|
||||||
extensions = {
|
extensions = {
|
||||||
['ui-select'] = require('telescope.themes').get_dropdown({}),
|
["ui-select"] = {
|
||||||
},
|
require("telescope.themes").get_dropdown {}
|
||||||
})
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
require('telescope').load_extension('ui-select')
|
require("telescope").load_extension("ui-select")
|
||||||
|
require("telescope").load_extension "file_browser"
|
||||||
|
|||||||
@@ -1,89 +1,155 @@
|
|||||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
local execute = vim.api.nvim_command
|
||||||
if not vim.uv.fs_stat(lazypath) then
|
local fn = vim.fn
|
||||||
local output = vim.fn.system({
|
|
||||||
'git', 'clone', '--filter=blob:none', '--branch=stable',
|
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||||
'https://github.com/folke/lazy.nvim.git', lazypath,
|
|
||||||
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
|
fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||||
|
execute 'packadd packer.nvim'
|
||||||
|
end
|
||||||
|
|
||||||
|
return require('packer').startup(function(use)
|
||||||
|
-- Packer can manage itself as an optional plugin
|
||||||
|
use 'wbthomason/packer.nvim'
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
use 'neovim/nvim-lspconfig'
|
||||||
|
use ({
|
||||||
|
'nvimdev/lspsaga.nvim',
|
||||||
|
config = function()
|
||||||
|
require('lspsaga').setup({})
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
if vim.v.shell_error ~= 0 then
|
use {
|
||||||
error('Could not install lazy.nvim: ' .. output)
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
run = ':TSUpdate'
|
||||||
|
}
|
||||||
|
-- Autocomplete
|
||||||
|
use 'hrsh7th/cmp-nvim-lsp'
|
||||||
|
use 'hrsh7th/cmp-buffer'
|
||||||
|
use 'https://codeberg.org/FelipeLema/cmp-async-path'
|
||||||
|
use 'dcampos/nvim-snippy'
|
||||||
|
use 'dcampos/cmp-snippy'
|
||||||
|
use 'hrsh7th/nvim-cmp'
|
||||||
|
|
||||||
|
-- Function signatures
|
||||||
|
use "ray-x/lsp_signature.nvim"
|
||||||
|
|
||||||
|
-- Theme
|
||||||
|
use 'drewtempelmeyer/palenight.vim'
|
||||||
|
use 'kyazdani42/nvim-web-devicons'
|
||||||
|
|
||||||
|
-- Syntax
|
||||||
|
use 'sheerun/vim-polyglot'
|
||||||
|
use 'https://codeberg.org/ziglang/zig.vim'
|
||||||
|
-- use {
|
||||||
|
--- 'prettier/vim-prettier',
|
||||||
|
-- run = "yarn install",
|
||||||
|
-- ft = {"javascript", "typescript", "json"}
|
||||||
|
-- }
|
||||||
|
use {'styled-components/vim-styled-components', branch = "main"}
|
||||||
|
use 'dominikduda/vim_current_word'
|
||||||
|
use {
|
||||||
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
|
ft = {'yaml', 'yml', 'helm'},
|
||||||
|
config = function()
|
||||||
|
vim.opt.list = true
|
||||||
|
vim.opt.listchars:append("space:⋅")
|
||||||
|
vim.opt.listchars:append("eol:↴")
|
||||||
|
|
||||||
|
require("indent_blankline").setup {
|
||||||
|
show_end_of_line = true,
|
||||||
|
space_char_blankline = " ",
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use 'airblade/vim-rooter'
|
||||||
|
|
||||||
|
-- Find tools.
|
||||||
|
use { "nvim-telescope/telescope-file-browser.nvim" }
|
||||||
|
use {'nvim-telescope/telescope-ui-select.nvim' }
|
||||||
|
use {
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}},
|
||||||
|
}
|
||||||
|
use { "junegunn/fzf" }
|
||||||
|
use { "junegunn/fzf.vim" }
|
||||||
|
use { "MagicDuck/grug-far.nvim" }
|
||||||
|
|
||||||
|
|
||||||
|
-- Diagnostics
|
||||||
|
-- Lua
|
||||||
|
use {
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
requires = "kyazdani42/nvim-web-devicons",
|
||||||
|
config = function()
|
||||||
|
require("trouble").setup {
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
}
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
}
|
||||||
|
|
||||||
-- Home Manager links the checked-in snapshot into the read-only Nix store.
|
-- Git symobls.
|
||||||
-- Seed a writable lockfile once. After :Lazy update, copy the state lockfile
|
use {
|
||||||
-- back to lazy-lock.json in this repo to commit reviewed plugin revisions.
|
'lewis6991/gitsigns.nvim',
|
||||||
local lockfile = vim.fn.stdpath('state') .. '/lazy-lock.json'
|
tag = 'release',
|
||||||
local snapshot = vim.fn.stdpath('config') .. '/lazy-lock.json'
|
config = function()
|
||||||
if not vim.uv.fs_stat(lockfile) and vim.uv.fs_stat(snapshot) then
|
require('gitsigns').setup()
|
||||||
vim.fn.mkdir(vim.fn.fnamemodify(lockfile, ':h'), 'p')
|
|
||||||
vim.fn.writefile(vim.fn.readfile(snapshot), lockfile)
|
|
||||||
end
|
end
|
||||||
|
}
|
||||||
|
|
||||||
require('lazy').setup({
|
use 'jiangmiao/auto-pairs'
|
||||||
-- LSP and completion
|
use 'itchyny/lightline.vim'
|
||||||
{ 'neovim/nvim-lspconfig', lazy = false },
|
use 'itchyny/vim-gitbranch'
|
||||||
{ 'hrsh7th/nvim-cmp', dependencies = {
|
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
|
||||||
'hrsh7th/cmp-buffer',
|
|
||||||
'hrsh7th/cmp-path',
|
|
||||||
'dcampos/nvim-snippy',
|
|
||||||
'dcampos/cmp-snippy',
|
|
||||||
}, lazy = false },
|
|
||||||
|
|
||||||
-- Appearance and syntax
|
-- Golang
|
||||||
{ 'drewtempelmeyer/palenight.vim', lazy = false, priority = 1000 },
|
use 'fatih/vim-go'
|
||||||
'nvim-tree/nvim-web-devicons',
|
|
||||||
'sheerun/vim-polyglot',
|
|
||||||
'https://codeberg.org/ziglang/zig.vim',
|
|
||||||
'styled-components/vim-styled-components',
|
|
||||||
'dominikduda/vim_current_word',
|
|
||||||
{ 'lukas-reineke/indent-blankline.nvim', main = 'ibl', ft = { 'yaml', 'helm' }, opts = {
|
|
||||||
scope = { enabled = false },
|
|
||||||
} },
|
|
||||||
'itchyny/lightline.vim',
|
|
||||||
'itchyny/vim-gitbranch',
|
|
||||||
{ 'tribela/transparent.nvim', opts = {} },
|
|
||||||
|
|
||||||
-- Navigation and search
|
-- Flutter/Dart
|
||||||
'airblade/vim-rooter',
|
use {'akinsho/flutter-tools.nvim', requires = 'nvim-lua/plenary.nvim'}
|
||||||
{ 'nvim-telescope/telescope.nvim', tag = 'v0.1.9', dependencies = {
|
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
'nvim-telescope/telescope-ui-select.nvim',
|
|
||||||
}, config = function()
|
|
||||||
require('nv-telescope')
|
|
||||||
end },
|
|
||||||
{ 'stevearc/oil.nvim', opts = {} },
|
|
||||||
{ 'MagicDuck/grug-far.nvim', opts = {} },
|
|
||||||
|
|
||||||
-- Diagnostics, Git, and editing
|
-- Pyhton
|
||||||
{ 'folke/trouble.nvim', opts = {} },
|
-- use 'a-vrma/black-nvim'
|
||||||
{ 'lewis6991/gitsigns.nvim', opts = {} },
|
use {
|
||||||
'jiangmiao/auto-pairs',
|
'psf/black', branch = "stable"
|
||||||
{ 'fatih/vim-go', init = function()
|
}
|
||||||
vim.g.go_code_completion_enabled = 0
|
|
||||||
vim.g.go_gopls_enabled = 0
|
-- Ocaml
|
||||||
vim.g.go_fmt_command = 'gofmt'
|
use {
|
||||||
vim.g.go_fmt_options = { gofmt = '-s' }
|
"stevearc/conform.nvim",
|
||||||
vim.g.go_imports_mode = 'goimports'
|
config = function()
|
||||||
vim.g.go_doc_keywordprg_enabled = 0
|
require("conform").setup({
|
||||||
vim.g.go_def_mapping_enabled = 0
|
formatters_by_ft = {
|
||||||
vim.g.go_search_bin_path_first = 0
|
ocaml = { "ocamlformat" },
|
||||||
vim.g.go_template_use_pkg = 1
|
},
|
||||||
vim.g.go_highlight_operators = 1
|
|
||||||
vim.g.go_highlight_types = 1
|
|
||||||
vim.g.go_highlight_extra_types = 1
|
|
||||||
vim.g.go_highlight_functions = 1
|
|
||||||
vim.g.go_highlight_function_calls = 1
|
|
||||||
end },
|
|
||||||
{ 'stevearc/conform.nvim', opts = {
|
|
||||||
formatters_by_ft = { ocaml = { 'ocamlformat' } },
|
|
||||||
} },
|
|
||||||
'tpope/vim-commentary',
|
|
||||||
'tpope/vim-surround',
|
|
||||||
'psliwka/vim-smoothie',
|
|
||||||
}, {
|
|
||||||
lockfile = lockfile,
|
|
||||||
checker = { enabled = false },
|
|
||||||
change_detection = { notify = false },
|
|
||||||
})
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
use 'tpope/vim-commentary'
|
||||||
|
use 'tpope/vim-surround'
|
||||||
|
|
||||||
|
-- Smooth scrolling
|
||||||
|
use 'psliwka/vim-smoothie'
|
||||||
|
|
||||||
|
-- Yuck (Eww config language).
|
||||||
|
-- use 'elkowar/yuck.vim'
|
||||||
|
|
||||||
|
-- Better file viewer
|
||||||
|
use({
|
||||||
|
"stevearc/oil.nvim",
|
||||||
|
config = function()
|
||||||
|
require("oil").setup()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
use({
|
||||||
|
"tribela/transparent.nvim",
|
||||||
|
config = function()
|
||||||
|
require("transparent").setup({})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
end)
|
||||||
|
|||||||
@@ -1,40 +1,45 @@
|
|||||||
vim.opt.iskeyword:append('-')
|
-- Comes from the Chris@Machine config.
|
||||||
vim.opt.hidden = true
|
|
||||||
vim.opt.wrap = false
|
|
||||||
vim.opt.fileencoding = 'utf-8'
|
|
||||||
vim.opt.splitbelow = true
|
|
||||||
vim.opt.splitright = true
|
|
||||||
vim.opt.conceallevel = 0
|
|
||||||
vim.opt.tabstop = 4
|
|
||||||
vim.opt.shiftwidth = 4
|
|
||||||
vim.opt.expandtab = true
|
|
||||||
vim.opt.smartindent = true
|
|
||||||
vim.opt.number = true
|
|
||||||
vim.opt.relativenumber = true
|
|
||||||
vim.opt.cursorline = true
|
|
||||||
vim.opt.showmode = false
|
|
||||||
vim.opt.backup = false
|
|
||||||
vim.opt.writebackup = false
|
|
||||||
vim.opt.signcolumn = 'yes'
|
|
||||||
vim.opt.updatetime = 300
|
|
||||||
vim.opt.timeoutlen = 500
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.cmd('set iskeyword+=-') -- treat dash separated words as a word text object"
|
||||||
pattern = { 'helm', 'yaml', 'yml' },
|
vim.o.hidden = true -- Required to keep multiple buffers open multiple buffers
|
||||||
callback = function()
|
vim.wo.wrap = false -- Display long lines as just one line
|
||||||
vim.opt_local.fixendofline = false
|
vim.o.fileencoding = "utf-8" -- The encoding written to file
|
||||||
vim.opt_local.list = true
|
vim.o.splitbelow = true -- Horizontal splits will automatically be below
|
||||||
vim.opt_local.listchars:append({ space = '⋅', eol = '↴' })
|
vim.o.splitright = true -- Vertical splits will automatically be to the right
|
||||||
end,
|
vim.o.conceallevel = 0 -- So that I can see `` in markdown files
|
||||||
})
|
vim.cmd('set ts=4') -- Insert 2 spaces for a tab
|
||||||
|
vim.cmd('set sw=4') -- Change the number of space characters inserted for indentation
|
||||||
|
vim.bo.expandtab = true -- Converts tabs to spaces
|
||||||
|
vim.bo.smartindent = true -- Makes indenting smart
|
||||||
|
vim.wo.number = true -- set numbered lines
|
||||||
|
vim.wo.cursorline = true -- Enable highlighting of the current line
|
||||||
|
--vim.o.showtabline = 2 -- Always show tabs
|
||||||
|
vim.o.showmode = false -- We don't need to see things like -- INSERT -- anymore
|
||||||
|
vim.o.backup = false -- This is recommended by coc
|
||||||
|
vim.o.writebackup = false -- This is recommended by coc
|
||||||
|
vim.wo.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||||
|
vim.o.updatetime = 300 -- Faster completion
|
||||||
|
vim.o.timeoutlen = 500 -- By default timeoutlen is 1000 ms
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.cmd(":set number relativenumber")
|
||||||
pattern = 'go',
|
|
||||||
callback = function()
|
|
||||||
vim.opt_local.colorcolumn = '80'
|
vim.cmd("autocmd FileType helm set nofixendofline")
|
||||||
vim.opt_local.formatoptions:append({ 'c', 'r' })
|
vim.cmd("autocmd FileType yaml set nofixendofline")
|
||||||
end,
|
vim.cmd("autocmd FileType yml set nofixendofline")
|
||||||
})
|
vim.cmd("autocmd BufReadPost * :lua require('gitsigns').setup()")
|
||||||
|
|
||||||
|
------ Folding
|
||||||
|
-- vim.o.foldlevel = 99
|
||||||
|
-- Persist folds.
|
||||||
|
-- Ignore errors.
|
||||||
|
-- vim.cmd([[
|
||||||
|
-- augroup AutoSaveFolds
|
||||||
|
-- autocmd!
|
||||||
|
-- autocmd BufWinLeave * silent! mkview
|
||||||
|
-- autocmd BufWinEnter * silent! loadview
|
||||||
|
-- augroup END
|
||||||
|
-- ]])
|
||||||
|
|
||||||
-- Show full file path in lightline.
|
-- Show full file path in lightline.
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
@@ -60,8 +65,21 @@ function! FilenameForLightline()
|
|||||||
endfunction
|
endfunction
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
-- Custom command for ripgrep.
|
||||||
|
-- vim.cmd([[
|
||||||
|
-- function! RipgrepFzf(query, fullscreen)
|
||||||
|
-- let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case -- %s || true'
|
||||||
|
-- let initial_command = printf(command_fmt, shellescape(a:query))
|
||||||
|
-- let reload_command = printf(command_fmt, '{q}')
|
||||||
|
-- let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]}
|
||||||
|
-- call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen)
|
||||||
|
-- endfunction
|
||||||
|
|
||||||
|
-- command! -nargs=* -bang RG call RipgrepFzf(<q-args>, <bang>0)
|
||||||
|
-- ]])
|
||||||
|
|
||||||
-- Use upstream zig plugin instead of polyglot.
|
-- Use upstream zig plugin instead of polyglot.
|
||||||
vim.g.polyglot_disabled = { 'zig' }
|
vim.g.polyglot_disabled = { "zig" }
|
||||||
|
|
||||||
-- Prioritize Objective-C
|
-- Prioritize Objective-C
|
||||||
vim.filetype.add({
|
vim.filetype.add({
|
||||||
@@ -71,15 +89,17 @@ vim.filetype.add({
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- Soft line wrapping for markdown.
|
-- Soft line wrapping for markdown.
|
||||||
local markdown_group = vim.api.nvim_create_augroup('MarkdownSpecific', { clear = true })
|
local markdown_group = vim.api.nvim_create_augroup("MarkdownSpecific", { clear = true })
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = 'markdown',
|
pattern = { "markdown" }, -- Match markdown file patterns
|
||||||
group = markdown_group,
|
group = markdown_group,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.opt_local.wrap = true
|
vim.opt_local.wrap = true
|
||||||
vim.opt_local.linebreak = true
|
vim.opt_local.linebreak = true
|
||||||
vim.opt_local.textwidth = 0
|
vim.opt_local.textwidth = 0 -- Visual wrap to window edge
|
||||||
vim.keymap.set('n', 'j', 'gj', { silent = true, buffer = true })
|
-- Optionally remap j/k for wrapped line navigation
|
||||||
vim.keymap.set('n', 'k', 'gk', { silent = true, buffer = true })
|
vim.keymap.set('n', 'j', 'gj', { noremap = true, silent = true, buffer = true })
|
||||||
|
vim.keymap.set('n', 'k', 'gk', { noremap = true, silent = true, buffer = true })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
{ ... }: {
|
|
||||||
|
|
||||||
home.file.".config/herdr/config.toml" = {
|
|
||||||
text = ''
|
|
||||||
[keys]
|
|
||||||
prefix = "ctrl+a"
|
|
||||||
|
|
||||||
# Use tmux-style session selection for workspace navigation.
|
|
||||||
workspace_picker = "prefix+s"
|
|
||||||
settings = "prefix+shift+s"
|
|
||||||
|
|
||||||
# Side-by-side panes (tmux's "|" / "\" split -h).
|
|
||||||
# NOTE: "backslash" as a key name is inferred, not confirmed in the docs.
|
|
||||||
# Verify against `herdr --default-config` and adjust if it doesn't bind.
|
|
||||||
split_vertical = "prefix+backslash"
|
|
||||||
|
|
||||||
# Stacked panes (tmux's "-" / "_" split -v).
|
|
||||||
split_horizontal = "prefix+minus"
|
|
||||||
|
|
||||||
detach = "prefix+d"
|
|
||||||
|
|
||||||
# Kept "f" for next-tab like the old tmux config; herdr's
|
|
||||||
# previous_tab default (prefix+p) already matched.
|
|
||||||
next_tab = "prefix+f"
|
|
||||||
|
|
||||||
close_pane = "prefix+w"
|
|
||||||
close_tab = "prefix+shift+w"
|
|
||||||
|
|
||||||
# Kept "," for rename-tab like the old tmux default.
|
|
||||||
rename_tab = "prefix+,"
|
|
||||||
|
|
||||||
[ui]
|
|
||||||
mouse_capture = true
|
|
||||||
|
|
||||||
[session]
|
|
||||||
# Replaces tmux-resurrect/continuum: agents and panes come back on reattach.
|
|
||||||
resume_agents_on_restore = true
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
taps = [
|
taps = [
|
||||||
|
# "agavra/tap"
|
||||||
];
|
];
|
||||||
brews = [
|
brews = [
|
||||||
"gh"
|
|
||||||
"watchman"
|
"watchman"
|
||||||
"vite"
|
"vite"
|
||||||
"pipx"
|
"pipx"
|
||||||
@@ -49,6 +49,7 @@
|
|||||||
"glow"
|
"glow"
|
||||||
"chromaprint"
|
"chromaprint"
|
||||||
"libiconv"
|
"libiconv"
|
||||||
|
# "agavra/tap/tuicr"
|
||||||
"automake"
|
"automake"
|
||||||
"autoconf"
|
"autoconf"
|
||||||
"pkg-config"
|
"pkg-config"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
opencode-tunneler,
|
opencode-tunneler,
|
||||||
godig,
|
godig,
|
||||||
|
herdr,
|
||||||
user,
|
user,
|
||||||
...
|
...
|
||||||
} :
|
} :
|
||||||
@@ -24,7 +25,6 @@ in {
|
|||||||
../../home-modules/secretive.nix
|
../../home-modules/secretive.nix
|
||||||
../../home-modules/starship.nix
|
../../home-modules/starship.nix
|
||||||
../../home-modules/tmux.nix
|
../../home-modules/tmux.nix
|
||||||
../../home-modules/herdr.nix
|
|
||||||
../../home-modules/opencode-config.nix
|
../../home-modules/opencode-config.nix
|
||||||
../../home-modules/zsh.nix
|
../../home-modules/zsh.nix
|
||||||
];
|
];
|
||||||
@@ -83,6 +83,7 @@ in {
|
|||||||
|
|
||||||
opencode-tunneler.packages.aarch64-darwin.default
|
opencode-tunneler.packages.aarch64-darwin.default
|
||||||
godig.packages.aarch64-darwin.service
|
godig.packages.aarch64-darwin.service
|
||||||
|
herdr.packages.aarch64-darwin.default
|
||||||
];
|
];
|
||||||
|
|
||||||
stateVersion = "24.11";
|
stateVersion = "24.11";
|
||||||
@@ -117,10 +118,9 @@ in {
|
|||||||
hostname = "82.180.160.149";
|
hostname = "82.180.160.149";
|
||||||
forwardAgent = true;
|
forwardAgent = true;
|
||||||
};
|
};
|
||||||
handmade-gitea = {
|
handmaderunner = {
|
||||||
user = "jmug";
|
user = "jmug";
|
||||||
hostname = "40.160.241.66";
|
hostname = "2.25.209.218";
|
||||||
forwardAgent = true;
|
|
||||||
};
|
};
|
||||||
racknerd = {
|
racknerd = {
|
||||||
user = "jmug";
|
user = "jmug";
|
||||||
|
|||||||
Reference in New Issue
Block a user