File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed
Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 6464}
6565```
6666
67+ ### Tree-Sitter parser
68+
69+ We are using a Tree-Sitter parser for our HTTP files, in order to get the correct syntax highlighting
70+ you should add this before your tree-sitter setup.
71+
72+ ``` lua
73+ local parser_configs = require (" nvim-treesitter.parsers" ).get_parser_configs ()
74+ parser_configs .http = {
75+ install_info = {
76+ url = " https://github.com/NTBBloodbath/tree-sitter-http" ,
77+ files = { " src/parser.c" },
78+ branch = " main" ,
79+ },
80+ }
81+ ```
82+
83+ And then add ` "http" ` in your ` ensure_installed ` table or manually run ` :TSInstall http ` .
84+
6785## Keybindings
6886
6987By default ` rest.nvim ` does not have any key mappings so you will not have
Original file line number Diff line number Diff line change 1+ au BufRead ,BufNewFile *.http set ft = http
Original file line number Diff line number Diff line change @@ -4,12 +4,8 @@ local config = require("rest-nvim.config")
44local curl = require (" rest-nvim.curl" )
55local LastOpts = {}
66
7- -- setup is needed for enabling syntax highlighting for http files
87rest .setup = function (user_configs )
98 config .set (user_configs or {})
10- if vim .fn .expand (" %:e" ) == " http" then
11- vim .api .nvim_buf_set_option (" %" , " filetype" , " http" )
12- end
139end
1410
1511-- run will retrieve the required request information from the current buffer
You can’t perform that action at this time.
0 commit comments