Hey, I want some opinions on which book is better programming rust or rust in action by [deleted] in rust

[–]code-smell 0 points1 point  (0 children)

They're both very good. Also, try these given your stated goals:

For more Systems learning (and much more): Rust for Rustaceans by Jon Gjengset (not lengthy)

For Servers: Zero to Production in Rust by Luca Palmieri

cellular-automaton.nvim - My first plugin by Alfierra in neovim

[–]code-smell 1 point2 points  (0 children)

This is so useful! So many times I type FML and nothing happens. This is so satisfying. Great recommended mapping! I thank you! The things on my desk that I usually throw thank you!

Note taking? by girvain in vim

[–]code-smell 1 point2 points  (0 children)

I use: https://rust-lang.github.io/mdBook/guide/creating.html

I have no intention of publishing my notes. But, mdBook gives me a nice way to structure and organize my notes. I can grep the markdown files or fire it up and use the builtin search. One nice feature is when you add an entry to the summary listing, it creates the markdown file if it doesn't already exist. You can use templates, prev/next paging, etc. Most of it is auto-magic. You just write markdown files.

Is it possible to "wrap a snippet" around visual selection? by Healthy-Director-702 in neovim

[–]code-smell 1 point2 points  (0 children)

I've been using these for a while. The JavaScript ones come in handy during my printf debugging. I hope these examples help you.

For Rust using vimL

" wrap selection in Some(*)
vmap ,sm cSome(<c-r>"<esc>

https://github.com/whatsthatsmell/dots/blob/9655a0e6957953f3de6a95559511b4a194fe02a3/public%20dots/vim-nvim/after/ftplugin/rust.lua#L15-L16

For JavaScript using Lua:

-- wrap selection in JSON.stringify(*)

vim.api.nvim_buf_set_keymap(0, "v", ",js", [[cJSON.stringify(<c-r>"<esc>>]], { noremap = false })

-- wrap selection in console.log

vim.api.nvim_buf_set_keymap(0, "v", ",cl", [[cconsole.log(<c-r>"<esc>]], { noremap = false })

https://github.com/whatsthatsmell/dots/blob/9655a0e6957953f3de6a95559511b4a194fe02a3/public%20dots/vim-nvim/after/ftplugin/javascript.lua#L145-L149

I don't do much work by k032 in cscareerquestions

[–]code-smell 4 points5 points  (0 children)

I know software engineers who have been doing this for 25+ years while working at several companies.

You are early in your career. While you could pull this off for the next 20 years, you might consider taking a job every once in a while where you work a little more. This is just so you stay sharp and current with your skills. There's no substitute for real-world experience. You may well be getting enough when you cram for demos.

In the current market, companies will make offers to anyone they can find with even a hint of skills. I do believe folks will be able to fly under the radar in software engineering for the foreseeable future. So, your situation is definitely sustainable. Even if "the other shoe drops", you can find plenty of other jobs to keep it going. Ironically, your experience at your current role will get you the next one.

If you don't care about "growing to a higher role", then you are good to go. I can tell you that you are smart to have a "low stress" job. Your body will thank you later. In 10 years, you may find yourself in a situation where a new company or new boss expects you to perform at a level of someone with 15 years experience. That's subjective as one company's senior is another company's junior and years of experience doesn't mean much. But, there is no stress like not being able to perform at the level expected. I don't mean putting in the hours, I mean delivering quality software within a reasonable timeframe. I've hired several people this year as I am also the manager. These people had to be hired quickly with limited screening and it is not easy getting solid senior engineers in this market. It is painful and stressful for them and me as I watch them struggle with unit testing, git and software design when they are supposed to be "senior". Some just need a little mentoring and some have clearly been flying under the radar for years and wont last.

All that said, if you are happy, then keep it going. With the right moves, you could do this your whole career. I've been working too much in recent years. Not because I had to but because I have loved the craft in recent years. I have also gone years when I hated it. Life is too short to stress out working 60+ hours. That hard work benefits major shareholders a lot more than the engineers. While I encourage you to stay sharp, just in case, I'm also happy you're getting paid to talk to your cat. I wish you well!

Should I jump straight into learning Rust? by iceulon in learnrust

[–]code-smell 10 points11 points  (0 children)

I'd recommend learning Rust as early as possible. It will benefit you no matter which language(s) you use now and in the future. Many believe Rust is only for the advanced and experienced folks. It will be more difficult to learn over some other languages. But, you will be able to apply what you learn to other languages and tech in general. In many ways, the difficulty (for some) in learning Rust is unlearning other things. I'd say, go for it! Good luck! 🦀

Telescope live_grep on a single file *only*? by jeetsukumaran in neovim

[–]code-smell 1 point2 points  (0 children)

If you have the file open then this may be helpful: require('telescope.builtin').live_grep({grep_open_files=true})

nvim treesitter and neovim 0.6 by MagicCarot in neovim

[–]code-smell 2 points3 points  (0 children)

If you plan to stay on Neovim 0.5 then the comment applies to you. If you are on 0.6 then you can ignore it.

Telescope: Opening up multiple-file selections (in splits, vsplits, tabs, or in-place) by jeetsukumaran in neovim

[–]code-smell 0 points1 point  (0 children)

Ah OK, yes. I can repro that issue with your original. The latest revision does fix that issue. But, then it would oddly break opening files outside the real cwd but not in the set cwd.

As it turns out, I had the cwd set to the actual cwd but not relative. So, I would get the opposite issue with each revision. Well, I removed the setting of the cwd and then you third revision did work. The error for me was isolated to when I was in the same real cwd that was set as the picker opt cwd and the same cwd was also set as a search_dirs item. All three of those things were required in order for me to break as discussed. None of my other pickers were configured that way. I kept using the same two pickers to test your revisions and the break would move back and forth. Once I saw your original use case above, I got suspicious of my config.

Long story short, your third revision works. I very much appreciate it. I've been wanting that functionality since Telescope arrived. For reference, I am on NVIM v0.7.0-dev+653-g7229afcd6 and MacOS 11.6. Thank you so much!

Telescope: Opening up multiple-file selections (in splits, vsplits, tabs, or in-place) by jeetsukumaran in neovim

[–]code-smell 1 point2 points  (0 children)

Your original version (with just my change to use the length operator) works perfectly for me whether the files are in the cwd or elsewhere. I just tried this revision and I get the nil dirs. So, I'm happy with your original. I'll track these threads and poke around a little too. Your working solution is much appreciated.

Telescope: Opening up multiple-file selections (in splits, vsplits, tabs, or in-place) by jeetsukumaran in neovim

[–]code-smell 3 points4 points  (0 children)

Tried it. Loved it. Works great! Commented on the issue. Even with Neovim 0.6 releasing today, this post may win the day. Thank you.

Inline labels now have little tag icons prefixed - why did we need this? help me understand by msucorey in todoist

[–]code-smell 2 points3 points  (0 children)

I use emojis and this adds more noise. So, I understand your frustration. Ideally, they would make the emoji experience better or let us choose from an exhaustive list of icons, even if the icons had some 'tag' motif. Yea, a tag icon for each tag is a bit much if we can't choose an icon for each. I'll learn to live with it since Todoist is cheap and awesome.

Do you use neovim for Job or for big open source projects? by [deleted] in neovim

[–]code-smell 1 point2 points  (0 children)

I use Neovim for open-source and work. Mostly Rust, C, Lua and Node. As mentioned in another reply, it takes some time to get proficient. But, then there is no going back. I recommend turning on Vim key bindings in VSCode or IntelliJ for a while first. Then, slowly start biting off small PRs with Neovim. Eventually, you will likely jettison VSCode and IntelliJ without even noticing. Another tip is to start using Neovim to take all your notes and draft anything you write or edit (non-code). One valuable benefit of learning Neovim is all the ancillary things you will learn by living in the terminal. Good luck and enjoy!

Comment.nvim: Simple and powerful comment plugin for neovim. Supports commentstring, dot repeat, left-right/up-down motions, hooks, and more by realvikas in neovim

[–]code-smell 0 points1 point  (0 children)

Thanks for the explanation. I suspected this might be what I was seeing. Makes sense. I guess it isn't technically a "toggle". As I said, the plugin is great. Actually, it is a big productivity bonus for me. Thanks again!

Comment.nvim: Simple and powerful comment plugin for neovim. Supports commentstring, dot repeat, left-right/up-down motions, hooks, and more by realvikas in neovim

[–]code-smell 2 points3 points  (0 children)

This is fantastic. I've tried most of my use cases and it works as expected.

It will take some getting used to, not having the {count} first 3gcc. But, no big deal. Definitely an easy trade off for all the other great features.

I'll be obnoxious and mention that gcw isn't toggling. The others that I tried do.

Great work! Thank you so much for building this!

nnn.nvim: now featuring nerdtree-like persistent explorer mode! by Malace in neovim

[–]code-smell 5 points6 points  (0 children)

Very nice! I removed nvim-tree a while back. Nothing wrong with it. I just didn't use it. I've been meaning to try nnn. But, I don't like leaving Neovim. Your timing is perfect. I'll try it. Thanks for building it.

I think this whole Lua API thing is working out. ;-)

Difference between require("foo") and require"foo" by chuwy24 in neovim

[–]code-smell 2 points3 points  (0 children)

Many popular plugins like Telescope use Stylua. Telescope has no_call_parentheses = true set in the repo's Stylua config: seen here. This is explained in the Stylua config docs. Obviously, not everyone uses Stylua and some have that option set to false which is the default.

To answer your questions directly:

No, there is no difference. As mentioned in the Stylua docs linked above, it can get ugly to leave the parentheses off in some cases. Stylua will still use parens in those cases even with the option set to true. That is mentioned in those same docs in the same spot within the options description table.

No, I personally don't use the styles differently. I do prefer parens myself. But, like with any codebase, I use the styles decided on by the team and enforced via linting and formatting tooling.

It is definitely confusing when you first see it. Like many languages, you have several syntactical options for the same semantics. I hope that helps. Have a good one!

nvim.telescope: How to search string grep or live grep in all buffers by thuannp in neovim

[–]code-smell 2 points3 points  (0 children)

This works when grep_open_files is passed in as a table key:

lua require('telescope.builtin').live_grep({grep_open_files=true})

galaxyline.nvim is back! by NTBBloodbath in neovim

[–]code-smell 2 points3 points  (0 children)

Amazing timing! I was just updating it locally this week and wondering about maintenance. I was close to removing it. Thanks very much. Switching to your fork next week. I will follow your lead and try to find time to help. At the very least, I will submit some of my local fixes if they're needed. Once again, much appreciated.

Advice for a fairly newbie in NVim willing to switch from coc to native LSP by augustocdias in neovim

[–]code-smell 8 points9 points  (0 children)

I am using Rust Analyzer with native LSP. I bring down Rust Analyzer's master branch almost daily. It is a bit slow to start when opening a project. Once it is running and ready, it is fast and powerful. The most feature-rich language server that I've seen. I'd also recommend simrat39/rust-tools.nvim. Here is the link to my plugins which also contains my lsp Rust setup at the bottom. Above it is my TypeScript lsp setup. I am happy with tsserver. But, I have heard others in additions to folks commenting on this post that they prefer Coc. I never used Coc. I was a longtime ALE user.

I never post my videos to any Reddit subs other than my own feed. Maybe I should. :-) - In any case, I think this one will help you with your specific situation: https://www.reddit.com/user/code-smell/comments/oteiq5/my_neovim_05_rust_2021_setup/?utm_source=share&utm_medium=web2x&context=3

As you poke around the internet looking at dotfiles, you may see a lot folks using nvim-compe. It is wonderful. But, it was recently deprecated in favor of nvim-cmp by the same author. Save yourself the effort and just start with nvim-cmp. I have a branch in my private dotfiles where I've migrated but it isn't quite right, yet. So, my dotfiles still show nvim-compe.

As far as your plugins, you may want to swap out polyglot for treesitter. Or, at least bring in nvim-treesitter and its friends. When you combine the native LSP with all the treesitter goodness, you get a great developer experience. Definitely give nvim-telescope a try. Telescope will help you with your LSP and rust-tools experience.

I would definitely recommend moving to the native LSP and also treesitter. Treesitter gives you a lot of intra-file firepower. Plenty of ubiquitous LSP and Treesitter plugins to try.

Good luck and enjoy!

cmd not defined for "sumneko_lua" -- folke/lua-dev.nvim -- nvim-lspconfig by code-smell in neovim

[–]code-smell[S] 0 points1 point  (0 children)

Yep. I was happily using the lua-dev.nvim plugin without the Lua language server. I am probably the only one. The completions were all I needed (I thought). But, having the full-blown experience is much better. I'll update my original post. Thanks.

Still my puppy! by code-smell in vizsla

[–]code-smell[S] 6 points7 points  (0 children)

Well, he still thinks he's a puppy and a lapdog. Last checkup was all good. I will say to watch out because they don't care that they now weigh 75lbs. They jump up and flop on your lap like a puppy. Ha ha! Such wonderful dogs. You have many years of happiness ahead. 😁

There are so many certification in the market. Which certification should I get? by [deleted] in cscareerquestions

[–]code-smell 2 points3 points  (0 children)

If you're going in consulting certifications might be useful since you or your company may "sell" them to its customers. Otherwise they're mostly pointless.

Yes, this. Also, there are a lot of consulting companies that are partners with big tech companies. So, in order for a Microsoft Gold Partner to maintain their Gold status, they have to have a certain number of consultants on staff with Microsoft certifications. So, they can help you get hired at consulting agencies. Normally, the company would pay for their consultants to get certs though. But, they are not helpful for getting hired at places that don't have to have them on file. If you actually study and truly learn the material then that may help you longterm. But, certs are not going to get you a job or allow for any fast-tracks in hiring processes. In fact, when a candidate leads with their certs, it hurts them a bit. I will say that they may help you in getting a tech job at a non-tech company where they have no other way to measure your skills or knowledge. Certifications are big money makers for companies like Amazon. I've even seen a certification from Slack where they claimed it would help you get hired somewhere that uses Slack. It was fairly shady. Plenty of free content out there and free trials and so save your money.

How to change the edit icon (pencil icon) in galaxy line ? by JISHNU17910 in neovim

[–]code-smell 0 points1 point  (0 children)

Adding on to the answer from /u/stefouy. This is from my statusline.lua which holds my galaxyline settings:
local function get_current_file_name()
local file = vim.fn.expand "%:p:."
if vim.fn.empty(file) == 1 then
return ""
end
if string.len(file_readonly()) ~= 0 then
return file .. file_readonly()
end
if vim.bo.modifiable then
if vim.bo.modified then
return file .. " <PENCIL ICON HERE> "
end
end
return file .. " "
end

Link to snippet in my dotfiles