Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/catgoose/angler.nvim
https://github.com/catgoose/angler.nvim
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/catgoose/angler.nvim
- Owner: catgoose
- Created: 2023-02-01T01:30:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-16T12:24:09.000Z (5 months ago)
- Last Synced: 2024-05-16T13:38:39.458Z (5 months ago)
- Language: Lua
- Size: 39.1 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# angler.nvim
A collection of Angular tools that I extracted out of my neovim config. The
"edit" API can be used elsewhere since it takes an extension as a parameter.## API
### open
- Opens file in cwd that shares basename with the current file with the
supplied extension appendedCall `require("angler").open(config)`
Open takes the following configuration parameter:```lua
{
extension = "ext", -- file extension to open that shares basename
--of current file
split = true -- split right
}
```### open_cwd
- Open next or previous file in the current directory
Call `require("angler").open_cwd(config)`
Open takes the following configuration parameter:```lua
{
order = "next", -- ordering of file open in cwd
-- next or prev
}
```## User commands
```lua
AnglerCompile
AnglerFixAll
AnglerRenameFile
AnglerRenameSymbol```
### AnglerCompile
Compiles with tsc and opens quickfix if issues were found
### AnglerFixAll
Fixes typescript issues
### AnglerRenameFile
Renames typescript file with `ui.input`
### AnglerRenameSymbol
Renames typescript symbol in workspace with `ui.input`
## Example setup with Lazy.nvim
```lua
local plugin = {
opts = opts,
keys = {
{"gc", [[require("angler").open({extension = "ts"})]]},
{"gh", [[require("angler").open({extension = "html"})]]},
{"gt", [[require("angler").open({
extension = "html",
split = true}
)]]},
{"gd", [[require("angler").open({extension = "scss"})]]},
{"gs", [[require("angler").open({
extension = "scss",
split = "true"
})]]},
{"gf", [[require("angler").open({extension = "spec.ts"})]]},
{"gn", [[require("angler").open_cwd({order = "next"})]]},
{"gp", [[require("angler").open_cwd({order = "prev"})]]},
{"tc", [[AnglerPopulateQF]]},
{"tf", [[AnglerRenameFile]]},
{"k", [[AnglerFixAll]]},
},
ft = "typescript",
dependencies = "jose-elias-alvarez/typescript.nvim",
}
```