Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/catgoose/angler.nvim


https://github.com/catgoose/angler.nvim

Last synced: about 2 months ago
JSON representation

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 appended

Call `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",
}
```