@@ -18,6 +18,7 @@ module.config.public = {
1818 fuzzy_backlinks = false ,
1919 roam_base_directory = " " ,
2020 node_name_randomiser = false ,
21+ node_name_snake_case = false ,
2122}
2223
2324module .load = function ()
@@ -324,8 +325,13 @@ module.public = {
324325 -- Map <C-n> to create a new node with the given title in the default note vault
325326 map (" i" , " <C-n>" , function ()
326327 local prompt = module .private .telescope_modules .state .get_current_line ()
327- local title_token = module .config .public .node_name_randomiser and name_tokeniser (prompt )
328- or prompt
328+ local title_token = prompt
329+ if module .config .public .node_name_randomiser then
330+ title_token = name_tokeniser (prompt )
331+ elseif module .config .public .node_name_snake_case then
332+ title_token = title_token :lower ()
333+ title_token = title_token :gsub (" " , " _" )
334+ end
329335 module .private .telescope_modules .actions .close (prompt_bufnr )
330336
331337 -- Ensure the vault directory exists
@@ -416,8 +422,13 @@ module.public = {
416422 function (_ , opt )
417423 -- Input query is in opt.__call_opts.query
418424 local prompt = opt .__call_opts .query
419- local title_token = module .config .public .node_name_randomiser and name_tokeniser (prompt )
420- or prompt
425+ local title_token = prompt
426+ if module .config .public .node_name_randomiser then
427+ title_token = name_tokeniser (prompt )
428+ elseif module .config .public .node_name_snake_case then
429+ title_token = title_token :lower ()
430+ title_token = title_token :gsub (" " , " _" )
431+ end
421432
422433 -- Ensure the vault directory exists
423434 local vault_dir = base_directory
0 commit comments