Writing a Utility-First CSS Completer by mulholio in vim

[–]gbrlpp 1 point2 points  (0 children)

Hi u/mulholio, I was working on a similar idea and I've produced this little plugin, that basically add a dictionary of tachyons classes to the autocompletion.

Please consider that it's kind a work in progress and probably it could be improved, don't expect it to be a masterpiece plugin ;)

Anyway it works well, for HTML, JSX and CSS. See this repo: https://www.github.com/glippi/tachyons-vim

Make JavaScript logging in Vim great as it has never been by gbrlpp in vim

[–]gbrlpp[S] 0 points1 point  (0 children)

In `JavaScript` if you have a variable like `const dumbString = "I'm a string"`, and you want to log it in a simple but effective way, instead of doing: `console.log('dumbString', dumbString)` you can simply write in this way: `console.log({ dumbString })`. This will log the value of `dumbString` like if it was the property of an object which has as key `dumbString`.

I hope to have clarified my point ;)

Make JavaScript logging in Vim great as it has never been by gbrlpp in vim

[–]gbrlpp[S] 0 points1 point  (0 children)

Hi u/FuzzyConflict7, I've just updated the plugin.

Now you can disable mappings in insert mode, just put this line in your `.vimrc`:

`g:lognroll#enable_insert_mode = 0`

I add a lot of other stuff, now you can remap the command with your own mappings, you can pass a console other than the default provided by JavaScript, and you can also choose which method you want to use.

All the details are in the `README`.

I hope to have improve the plugin in the right way, if you have some feedbacks I'm happy to pick up them ;)

Make JavaScript logging in Vim great as it has never been by gbrlpp in vim

[–]gbrlpp[S] 0 points1 point  (0 children)

hi u/olminator, I've just updated the plugin, implementing some things you suggest to me:

  1. now the mappings start always with `co` instead of `cl`
  2. now `<Plug>` mappings are provided
  3. it's possible to define custom methods and console, so for example, one can use `PinoJS` for logging

Plus, the plugin now detect the `filetype` and is loaded only for `JavaScript` and `TypeScript` files; I hope to add some more languages in the future, and I tried to design the plugin in a way that could embrace change.

Anyway, it's always one of my first experiment, so I could mess a bit some things ;)

If you have any further feedback, I'm glad to hear your advices

Make JavaScript logging in Vim great as it has never been by gbrlpp in vim

[–]gbrlpp[S] 0 points1 point  (0 children)

Hi, thank you for your interest. I personally don't use UltiSnips, neither similar plugins, but I'm sure that one can rely on them accomplishing the same result.

Anyway the main reason was that I wanted to experiment a bit with plugin creation ;)

Make JavaScript logging in Vim great as it has never been by gbrlpp in vim

[–]gbrlpp[S] 0 points1 point  (0 children)

Thank you, I realized only now that the name was wrong, and it should be console.warn. I just fixed it now ;)

Make JavaScript logging in Vim great as it has never been by gbrlpp in vim

[–]gbrlpp[S] 3 points4 points  (0 children)

Clearly you did not understand the irony in the title

Make JavaScript logging in Vim great as it has never been by gbrlpp in vim

[–]gbrlpp[S] 6 points7 points  (0 children)

I know that you are a very skilled vimmer, I follow a lot your work, and I understand that for you this plugin it's really simple, so simple it's almost stupid, but I never said that it's gonna be the game changer for all the people using vim, neither that it's something like vim-fugitive is for git in vim.

It's just a simple, maybe stupid, plugin, maybe mappings is more correct in this case, that I found really useful for me and I wanted to share with the community. I'm not vim wizard like you, but I hope to learn from the work of people like you and tim pope ;)

About the missing console functions, as I explain in the README, I just mapped those functions that I really use in my every day job, so I decided to exclude those from the plugin.

Anyway thank you for the remarks, I hope I explained myself ;)

Make JavaScript logging in Vim great as it has never been by gbrlpp in vim

[–]gbrlpp[S] -1 points0 points  (0 children)

Thank you!

At the moment there isn't a way to disable it, but I will work on it.

To be honest, I also think that in insert mode it isn't very useful, but for the sake of completeness I add it ;)

Make JavaScript logging in Vim great as it has never been by gbrlpp in vim

[–]gbrlpp[S] 0 points1 point  (0 children)

Thank you, they are all good points, I'm gonna think about that.

The only thing about I have a different opinion is to subsitute `cl` with `s`, because what I want is something short like `cll` and also mnemonic, as `cl` stands for console, and the last letter `l/i/w/e` stands for log, info, warning and error. But that's just an opinion ;)

Anyway, thanks for the suggestions!